2012-11-26 18:58:24 +00:00
|
|
|
/*
|
|
|
|
===========================================================================
|
|
|
|
|
|
|
|
Doom 3 BFG Edition GPL Source Code
|
2012-11-28 15:47:07 +00:00
|
|
|
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
2012-11-26 18:58:24 +00:00
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
2012-11-26 18:58:24 +00:00
|
|
|
|
|
|
|
Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
|
|
|
|
|
|
|
|
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
|
|
|
|
|
|
|
|
===========================================================================
|
|
|
|
*/
|
|
|
|
#pragma hdrstop
|
2012-12-22 15:18:19 +00:00
|
|
|
#include "precompiled.h"
|
2012-11-26 18:58:24 +00:00
|
|
|
#include "../Game_local.h"
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
idMenuScreen::idMenuScreen()
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
menuGUI = NULL;
|
|
|
|
transition = MENU_TRANSITION_INVALID;
|
|
|
|
}
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
idMenuScreen::~idMenuScreen()
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
========================
|
|
|
|
idMenuScreen::ObserveEvent
|
|
|
|
========================
|
|
|
|
*/
|
2012-11-28 15:47:07 +00:00
|
|
|
void idMenuScreen::ObserveEvent( const idMenuWidget& widget, const idWidgetEvent& event )
|
|
|
|
{
|
|
|
|
if( event.type == WIDGET_EVENT_COMMAND )
|
|
|
|
{
|
|
|
|
switch( event.arg )
|
|
|
|
{
|
|
|
|
case idMenuWidget_CommandBar::BUTTON_JOY1:
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
ReceiveEvent( idWidgetEvent( WIDGET_EVENT_PRESS, 0, event.thisObject, event.parms ) );
|
|
|
|
break;
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
case idMenuWidget_CommandBar::BUTTON_JOY2:
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
ReceiveEvent( idWidgetEvent( WIDGET_EVENT_BACK, 0, event.thisObject, event.parms ) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
========================
|
|
|
|
idMenuScreen::Update
|
|
|
|
========================
|
|
|
|
*/
|
2012-11-28 15:47:07 +00:00
|
|
|
void idMenuScreen::Update()
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
if( menuGUI == NULL )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
//
|
|
|
|
// Display
|
|
|
|
//
|
2012-11-28 15:47:07 +00:00
|
|
|
for( int childIndex = 0; childIndex < GetChildren().Num(); ++childIndex )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
GetChildByIndex( childIndex ).Update();
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
if( menuData != NULL )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
menuData->UpdateChildren();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
========================
|
|
|
|
idMenuScreen::UpdateCmds
|
|
|
|
========================
|
|
|
|
*/
|
2012-11-28 15:47:07 +00:00
|
|
|
void idMenuScreen::UpdateCmds()
|
|
|
|
{
|
|
|
|
idSWF* const gui = menuGUI;
|
|
|
|
|
|
|
|
idSWFScriptObject* const shortcutKeys = gui->GetGlobal( "shortcutKeys" ).GetObject();
|
|
|
|
if( !verify( shortcutKeys != NULL ) )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
idSWFScriptVar clearFunc = shortcutKeys->Get( "clear" );
|
2012-11-28 15:47:07 +00:00
|
|
|
if( clearFunc.IsFunction() )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
clearFunc.GetFunction()->Call( NULL, idSWFParmList() );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
// NAVIGATION: UP/DOWN, etc.
|
2012-11-28 15:47:07 +00:00
|
|
|
idSWFScriptObject* const buttons = gui->GetRootObject().GetObject( "buttons" );
|
|
|
|
if( buttons != NULL )
|
|
|
|
{
|
|
|
|
|
|
|
|
idSWFScriptObject* const btnUp = buttons->GetObject( "btnUp" );
|
|
|
|
if( btnUp != NULL )
|
|
|
|
{
|
|
|
|
btnUp->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_UP, SCROLL_SINGLE ) );
|
|
|
|
btnUp->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_UP_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "UP", btnUp );
|
|
|
|
shortcutKeys->Set( "MWHEEL_UP", btnUp );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnDown = buttons->GetObject( "btnDown" );
|
|
|
|
if( btnDown != NULL )
|
|
|
|
{
|
|
|
|
btnDown->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_DOWN, SCROLL_SINGLE ) );
|
|
|
|
btnDown->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_DOWN_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "DOWN", btnDown );
|
|
|
|
shortcutKeys->Set( "MWHEEL_DOWN", btnDown );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnUp_LStick = buttons->GetObject( "btnUp_LStick" );
|
|
|
|
if( btnUp_LStick != NULL )
|
|
|
|
{
|
|
|
|
btnUp_LStick->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_UP_LSTICK, SCROLL_SINGLE ) );
|
|
|
|
btnUp_LStick->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_UP_LSTICK_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "STICK1_UP", btnUp_LStick );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnDown_LStick = buttons->GetObject( "btnDown_LStick" );
|
|
|
|
if( btnDown_LStick != NULL )
|
|
|
|
{
|
|
|
|
btnDown_LStick->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_DOWN_LSTICK, SCROLL_SINGLE ) );
|
|
|
|
btnDown_LStick->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_DOWN_LSTICK_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "STICK1_DOWN", btnDown_LStick );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnUp_RStick = buttons->GetObject( "btnUp_RStick" );
|
|
|
|
if( btnUp_RStick != NULL )
|
|
|
|
{
|
|
|
|
btnUp_RStick->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_UP_RSTICK, SCROLL_SINGLE ) );
|
|
|
|
btnUp_RStick->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_UP_RSTICK_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "STICK2_UP", btnUp_RStick );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnDown_RStick = buttons->GetObject( "btnDown_RStick" );
|
|
|
|
if( btnDown_RStick != NULL )
|
|
|
|
{
|
|
|
|
btnDown_RStick->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_DOWN_RSTICK, SCROLL_SINGLE ) );
|
|
|
|
btnDown_RStick->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_DOWN_RSTICK_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "STICK2_DOWN", btnDown_RStick );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnPageUp = buttons->GetObject( "btnPageUp" );
|
|
|
|
if( btnPageUp != NULL )
|
|
|
|
{
|
|
|
|
btnPageUp->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_PAGEUP, SCROLL_PAGE ) );
|
|
|
|
btnPageUp->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_PAGEUP_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "PGUP", btnPageUp );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnPageDown = buttons->GetObject( "btnPageDown" );
|
|
|
|
if( btnPageDown != NULL )
|
|
|
|
{
|
|
|
|
btnPageDown->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_PAGEDWN, SCROLL_PAGE ) );
|
|
|
|
btnPageDown->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_PAGEDWN_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "PGDN", btnPageDown );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnHome = buttons->GetObject( "btnHome" );
|
|
|
|
if( btnHome != NULL )
|
|
|
|
{
|
|
|
|
btnHome->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_UP, SCROLL_FULL ) );
|
|
|
|
btnHome->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_UP_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "HOME", btnHome );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnEnd = buttons->GetObject( "btnEnd" );
|
|
|
|
if( btnEnd != NULL )
|
|
|
|
{
|
|
|
|
btnEnd->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_DOWN, SCROLL_FULL ) );
|
|
|
|
btnEnd->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_DOWN_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "END", btnEnd );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnLeft = buttons->GetObject( "btnLeft" );
|
|
|
|
if( btnLeft != NULL )
|
|
|
|
{
|
|
|
|
btnLeft->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_LEFT, 0 ) );
|
|
|
|
btnLeft->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_LEFT_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "LEFT", btnLeft );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnRight = buttons->GetObject( "btnRight" );
|
|
|
|
if( btnRight != NULL )
|
|
|
|
{
|
|
|
|
btnRight->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_RIGHT, 0 ) );
|
|
|
|
btnRight->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_RIGHT_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "RIGHT", btnRight );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnLeft_LStick = buttons->GetObject( "btnLeft_LStick" );
|
|
|
|
if( btnLeft_LStick != NULL )
|
|
|
|
{
|
|
|
|
btnLeft_LStick->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_LEFT_LSTICK, 0 ) );
|
|
|
|
btnLeft_LStick->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_LEFT_LSTICK_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "STICK1_LEFT", btnLeft_LStick );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnRight_LStick = buttons->GetObject( "btnRight_LStick" );
|
|
|
|
if( btnRight_LStick != NULL )
|
|
|
|
{
|
|
|
|
btnRight_LStick->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_RIGHT_LSTICK, 0 ) );
|
|
|
|
btnRight_LStick->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_RIGHT_LSTICK_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "STICK1_RIGHT", btnRight_LStick );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnLeft_RStick = buttons->GetObject( "btnLeft_RStick" );
|
|
|
|
if( btnLeft_RStick != NULL )
|
|
|
|
{
|
|
|
|
btnLeft_RStick->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_LEFT_RSTICK, 0 ) );
|
|
|
|
btnLeft_RStick->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_LEFT_RSTICK_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "STICK2_LEFT", btnLeft_RStick );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const btnRight_RStick = buttons->GetObject( "btnRight_RStick" );
|
|
|
|
if( btnRight_RStick != NULL )
|
|
|
|
{
|
|
|
|
btnRight_RStick->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_RIGHT_RSTICK, 0 ) );
|
|
|
|
btnRight_RStick->Set( "onRelease", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_SCROLL_RIGHT_RSTICK_RELEASE, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "STICK2_RIGHT", btnRight_RStick );
|
|
|
|
}
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
idSWFScriptObject* const navigation = gui->GetRootObject().GetObject( "navBar" );
|
|
|
|
if( navigation != NULL )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
// TAB NEXT
|
2012-11-28 15:47:07 +00:00
|
|
|
idSWFScriptObject* const btnTabNext = navigation->GetNestedObj( "options", "btnTabNext" );
|
|
|
|
if( btnTabNext != NULL )
|
|
|
|
{
|
|
|
|
btnTabNext->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_TAB_NEXT, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "JOY6", btnTabNext );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
if( btnTabNext->GetSprite() != NULL && menuData != NULL )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
btnTabNext->GetSprite()->StopFrame( menuData->GetPlatform() + 1 );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
// TAB PREV
|
2012-11-28 15:47:07 +00:00
|
|
|
idSWFScriptObject* const btnTabPrev = navigation->GetNestedObj( "options", "btnTabPrev" );
|
|
|
|
if( btnTabPrev != NULL )
|
|
|
|
{
|
|
|
|
btnTabPrev->Set( "onPress", new( TAG_SWF ) WrapWidgetSWFEvent( this, WIDGET_EVENT_TAB_PREV, 0 ) );
|
2012-11-26 18:58:24 +00:00
|
|
|
shortcutKeys->Set( "JOY5", btnTabPrev );
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
if( btnTabPrev->GetSprite() != NULL && menuData != NULL )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
btnTabPrev->GetSprite()->StopFrame( menuData->GetPlatform() + 1 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
========================
|
|
|
|
idMenuScreen::HideScreen
|
|
|
|
========================
|
|
|
|
*/
|
2012-11-28 15:47:07 +00:00
|
|
|
void idMenuScreen::HideScreen( const mainMenuTransition_t transitionType )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
if( menuGUI == NULL )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-11-28 15:47:07 +00:00
|
|
|
if( !BindSprite( menuGUI->GetRootObject() ) )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
if( transitionType == MENU_TRANSITION_SIMPLE )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
GetSprite()->PlayFrame( "rollOff" );
|
2012-11-28 15:47:07 +00:00
|
|
|
}
|
|
|
|
else if( transitionType == MENU_TRANSITION_ADVANCE )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
GetSprite()->PlayFrame( "rollOffBack" );
|
2012-11-28 15:47:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
GetSprite()->PlayFrame( "rollOffFront" );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
Update();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
========================
|
|
|
|
idMenuScreen::ShowScreen
|
|
|
|
========================
|
|
|
|
*/
|
2012-11-28 15:47:07 +00:00
|
|
|
void idMenuScreen::ShowScreen( const mainMenuTransition_t transitionType )
|
|
|
|
{
|
|
|
|
if( menuGUI == NULL )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
|
|
|
if( !BindSprite( menuGUI->GetRootObject() ) )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
GetSprite()->SetVisible( true );
|
2012-11-28 15:47:07 +00:00
|
|
|
if( transitionType == MENU_TRANSITION_SIMPLE )
|
|
|
|
{
|
|
|
|
if( menuData != NULL && menuData->ActiveScreen() != -1 )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
menuData->PlaySound( GUI_SOUND_BUILD_ON );
|
|
|
|
}
|
|
|
|
GetSprite()->PlayFrame( "rollOn" );
|
2012-11-28 15:47:07 +00:00
|
|
|
}
|
|
|
|
else if( transitionType == MENU_TRANSITION_ADVANCE )
|
|
|
|
{
|
|
|
|
if( menuData != NULL && menuData->ActiveScreen() != -1 )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
menuData->PlaySound( GUI_SOUND_BUILD_ON );
|
|
|
|
}
|
|
|
|
GetSprite()->PlayFrame( "rollOnFront" );
|
2012-11-28 15:47:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( menuData != NULL )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
menuData->PlaySound( GUI_SOUND_BUILD_OFF );
|
|
|
|
}
|
|
|
|
GetSprite()->PlayFrame( "rollOnBack" );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
Update();
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
SetFocusIndex( GetFocusIndex(), true );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
========================
|
|
|
|
idMenuScreen::HandleMenu
|
|
|
|
|
|
|
|
NOTE: This is holdover from the way the menu system was setup before. It should be able to
|
|
|
|
be removed when the old way is fully replaced, and instead events will just be sent directly
|
|
|
|
to the screen.
|
|
|
|
========================
|
|
|
|
*/
|
2012-11-28 15:47:07 +00:00
|
|
|
void idMenuScreen::HandleMenu( const mainMenuTransition_t type )
|
|
|
|
{
|
|
|
|
if( type == MENU_TRANSITION_ADVANCE )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
ReceiveEvent( idWidgetEvent( WIDGET_EVENT_PRESS, 0, NULL, idSWFParmList() ) );
|
2012-11-28 15:47:07 +00:00
|
|
|
}
|
|
|
|
else if( type == MENU_TRANSITION_BACK )
|
|
|
|
{
|
2012-11-26 18:58:24 +00:00
|
|
|
ReceiveEvent( idWidgetEvent( WIDGET_EVENT_BACK, 0, NULL, idSWFParmList() ) );
|
|
|
|
}
|
2012-11-28 15:47:07 +00:00
|
|
|
|
2012-11-26 18:58:24 +00:00
|
|
|
transition = type;
|
|
|
|
}
|
|
|
|
|