DOOM-3-BFG

DOOM 3 BFG Edition
Log | Files | Refs

MenuScreen_Shell_Pause.cpp (18549B)


      1 /*
      2 ===========================================================================
      3 
      4 Doom 3 BFG Edition GPL Source Code
      5 Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. 
      6 
      7 This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").  
      8 
      9 Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
     10 it under the terms of the GNU General Public License as published by
     11 the Free Software Foundation, either version 3 of the License, or
     12 (at your option) any later version.
     13 
     14 Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
     15 but WITHOUT ANY WARRANTY; without even the implied warranty of
     16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17 GNU General Public License for more details.
     18 
     19 You should have received a copy of the GNU General Public License
     20 along with Doom 3 BFG Edition Source Code.  If not, see <http://www.gnu.org/licenses/>.
     21 
     22 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.
     23 
     24 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.
     25 
     26 ===========================================================================
     27 */
     28 #pragma hdrstop
     29 #include "../../idLib/precompiled.h"
     30 #include "../Game_local.h"
     31 
     32 extern idCVar g_demoMode;
     33 const static int NUM_PAUSE_OPTIONS = 6;
     34 
     35 enum pauseMenuCmds_t {
     36 	PAUSE_CMD_RESTART,
     37 	PAUSE_CMD_DEAD_RESTART,
     38 	PAUSE_CMD_SETTINGS,
     39 	PAUSE_CMD_EXIT,
     40 	PAUSE_CMD_LEAVE,
     41 	PAUSE_CMD_RETURN,
     42 	PAUSE_CMD_LOAD,
     43 	PAUSE_CMD_SAVE,
     44 	PAUSE_CMD_PS3,
     45 	PAUSE_CMD_INVITE_FRIENDS
     46 };
     47 
     48 /*
     49 ========================
     50 idMenuScreen_Shell_Pause::Initialize
     51 ========================
     52 */
     53 void idMenuScreen_Shell_Pause::Initialize( idMenuHandler * data ) {
     54 	idMenuScreen::Initialize( data );
     55 
     56 	if ( data != NULL ) {
     57 		menuGUI = data->GetGUI();
     58 	}
     59 
     60 	SetSpritePath( "menuPause" );
     61 
     62 	options = new  (TAG_SWF) idMenuWidget_DynamicList();
     63 	options->SetNumVisibleOptions( NUM_PAUSE_OPTIONS );
     64 	options->SetSpritePath( GetSpritePath(), "info", "options" );
     65 	options->SetWrappingAllowed( true );
     66 	AddChild( options );
     67 
     68 	idMenuWidget_Help * const helpWidget = new ( TAG_SWF ) idMenuWidget_Help();
     69 	helpWidget->SetSpritePath( GetSpritePath(), "info", "helpTooltip" );
     70 	AddChild( helpWidget );
     71 
     72 	while ( options->GetChildren().Num() < NUM_PAUSE_OPTIONS ) {
     73 		idMenuWidget_Button * const buttonWidget = new  (TAG_SWF) idMenuWidget_Button();
     74 		buttonWidget->Initialize( data );
     75 		buttonWidget->RegisterEventObserver( helpWidget );
     76 		options->AddChild( buttonWidget );
     77 	}
     78 	options->Initialize( data );
     79 	
     80 	options->AddEventAction( WIDGET_EVENT_SCROLL_DOWN ).Set( new (TAG_SWF) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_SCROLL_DOWN_START_REPEATER, WIDGET_EVENT_SCROLL_DOWN ) );
     81 	options->AddEventAction( WIDGET_EVENT_SCROLL_UP ).Set( new (TAG_SWF) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_SCROLL_UP_START_REPEATER, WIDGET_EVENT_SCROLL_UP ) );
     82 	options->AddEventAction( WIDGET_EVENT_SCROLL_DOWN_RELEASE ).Set( new (TAG_SWF) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_STOP_REPEATER, WIDGET_EVENT_SCROLL_DOWN_RELEASE ) );
     83 	options->AddEventAction( WIDGET_EVENT_SCROLL_UP_RELEASE ).Set( new (TAG_SWF) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_STOP_REPEATER, WIDGET_EVENT_SCROLL_UP_RELEASE ) );
     84 	options->AddEventAction( WIDGET_EVENT_SCROLL_DOWN_LSTICK ).Set( new (TAG_SWF) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_SCROLL_DOWN_START_REPEATER, WIDGET_EVENT_SCROLL_DOWN_LSTICK ) );
     85 	options->AddEventAction( WIDGET_EVENT_SCROLL_UP_LSTICK ).Set( new (TAG_SWF) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_SCROLL_UP_START_REPEATER, WIDGET_EVENT_SCROLL_UP_LSTICK ) );
     86 	options->AddEventAction( WIDGET_EVENT_SCROLL_DOWN_LSTICK_RELEASE ).Set( new (TAG_SWF) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_STOP_REPEATER, WIDGET_EVENT_SCROLL_DOWN_LSTICK_RELEASE ) );
     87 	options->AddEventAction( WIDGET_EVENT_SCROLL_UP_LSTICK_RELEASE ).Set( new (TAG_SWF) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_STOP_REPEATER, WIDGET_EVENT_SCROLL_UP_LSTICK_RELEASE ) );
     88 }
     89 
     90 /*
     91 ========================
     92 idMenuScreen_Shell_Pause::Update
     93 ========================
     94 */
     95 void idMenuScreen_Shell_Pause::Update() {
     96 
     97 	if ( menuData != NULL ) {
     98 		idMenuWidget_CommandBar * cmdBar = menuData->GetCmdBar();
     99 		if ( cmdBar != NULL ) {
    100 			cmdBar->ClearAllButtons();
    101 			idMenuWidget_CommandBar::buttonInfo_t * buttonInfo;
    102 			buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY1 );
    103 			if ( menuData->GetPlatform() != 2 ) {
    104 				buttonInfo->label = "#str_SWF_SELECT";
    105 			}
    106 			buttonInfo->action.Set( WIDGET_ACTION_PRESS_FOCUSED );
    107 			
    108 			bool isDead = false;
    109 			idPlayer * player = gameLocal.GetLocalPlayer();
    110 			if ( player != NULL ) {
    111 				if ( player->health <= 0 ) {
    112 					isDead = true;
    113 				}
    114 			}
    115 
    116 			if ( !isDead ) {
    117 				buttonInfo = cmdBar->GetButton( idMenuWidget_CommandBar::BUTTON_JOY2 );
    118 				if ( menuData->GetPlatform() != 2 ) {
    119 					buttonInfo->label = "#str_00395";
    120 				}
    121 				buttonInfo->action.Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_RETURN );
    122 			}
    123 		}		
    124 	}
    125 
    126 	idMenuScreen::Update();
    127 }
    128 
    129 /*
    130 ========================
    131 idMenuScreen_Shell_Pause::ShowScreen
    132 ========================
    133 */
    134 void idMenuScreen_Shell_Pause::ShowScreen( const mainMenuTransition_t transitionType ) {
    135 	
    136 	idList< idList< idStr, TAG_IDLIB_LIST_MENU >, TAG_IDLIB_LIST_MENU > menuOptions;	
    137 	idList< idStr > option;
    138 
    139 	bool isDead = false;
    140 	idPlayer * player = gameLocal.GetLocalPlayer();
    141 	if ( player != NULL ) {
    142 		if ( player->health <= 0 ) {
    143 			isDead = true;
    144 		}
    145 	}
    146 
    147 	if ( g_demoMode.GetBool() ) {
    148 		isMpPause = false;
    149 		if ( isDead ) {
    150 			option.Append( "#str_swf_restart_map" );	// retart map
    151 			menuOptions.Append( option );
    152 			option.Clear();
    153 			option.Append( "#str_swf_settings" );	// settings
    154 			menuOptions.Append( option );
    155 			option.Clear();
    156 			option.Append( "#str_swf_exit_game" );	// exit game
    157 			menuOptions.Append( option );
    158 
    159 			int index = 0;
    160 			options->GetChildByIndex( index ).ClearEventActions();
    161 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_DEAD_RESTART );
    162 			index++;
    163 			options->GetChildByIndex( index ).ClearEventActions();
    164 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_SETTINGS );
    165 			index++;
    166 			options->GetChildByIndex( index ).ClearEventActions();
    167 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_LEAVE );
    168 		} else {
    169 			option.Append( "#str_04106" );	// return to game
    170 			menuOptions.Append( option );
    171 			option.Clear();
    172 			option.Append( "#str_swf_restart_map" );	// retart map
    173 			menuOptions.Append( option );
    174 			option.Clear();
    175 			option.Append( "#str_swf_settings" );	// settings
    176 			menuOptions.Append( option );
    177 			option.Clear();
    178 			option.Append( "#str_swf_exit_game" );	// exit game
    179 			menuOptions.Append( option );
    180 
    181 			int index = 0;
    182 			options->GetChildByIndex( index ).ClearEventActions();
    183 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_RETURN );
    184 			index++;
    185 			options->GetChildByIndex( index ).ClearEventActions();
    186 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_RESTART );
    187 			index++;
    188 			options->GetChildByIndex( index ).ClearEventActions();
    189 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_SETTINGS );
    190 			index++;
    191 			options->GetChildByIndex( index ).ClearEventActions();
    192 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_EXIT );
    193 		}
    194 	} else {
    195 		if ( common->IsMultiplayer() ) {
    196 			isMpPause = true;
    197 			option.Append( "#str_04106" );	// return to game
    198 			menuOptions.Append( option );
    199 			option.Clear();
    200 			option.Append( "#str_swf_settings" );	// settings
    201 			menuOptions.Append( option );
    202 			option.Clear();
    203 			option.Append( "#str_swf_invite_friends_upper" );	// settings
    204 			menuOptions.Append( option );
    205 			option.Clear();
    206 			option.Append( "#str_swf_leave_game" );	// leave game
    207 			menuOptions.Append( option );		
    208 
    209 			int index = 0;
    210 			idMenuWidget_Button * buttonWidget = NULL;
    211 			options->GetChildByIndex( index ).ClearEventActions();
    212 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_RETURN );
    213 			buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    214 			if ( buttonWidget != NULL ) {
    215 				buttonWidget->SetDescription( "#str_swf_resume_desc" );
    216 			}
    217 			index++;
    218 			options->GetChildByIndex( index ).ClearEventActions();
    219 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_SETTINGS );
    220 			buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    221 			if ( buttonWidget != NULL ) {
    222 				buttonWidget->SetDescription( "#str_02206" );
    223 			}
    224 			index++;
    225 			options->GetChildByIndex( index ).ClearEventActions();
    226 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_INVITE_FRIENDS );
    227 			buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    228 			if ( buttonWidget != NULL ) {
    229 				buttonWidget->SetDescription( "#str_swf_invite_desc" );
    230 			}
    231 			index++;
    232 			options->GetChildByIndex( index ).ClearEventActions();
    233 			options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_LEAVE );
    234 			buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    235 			if ( buttonWidget != NULL ) {
    236 				buttonWidget->SetDescription( "#str_swf_exit_game_desc" );
    237 			}
    238 
    239 		} else {
    240 			isMpPause = false;
    241 			if ( isDead ) {
    242 				option.Append( "#str_02187" );	// load game
    243 				menuOptions.Append( option );
    244 				option.Clear();
    245 				option.Append( "#str_swf_settings" );	// settings
    246 				menuOptions.Append( option );
    247 				option.Clear();
    248 				option.Append( "#str_swf_exit_game" );	// exit game
    249 				menuOptions.Append( option );
    250 
    251 				int index = 0;
    252 				idMenuWidget_Button * buttonWidget = NULL;
    253 				options->GetChildByIndex( index ).ClearEventActions();
    254 				options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_LOAD );
    255 				buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    256 				if ( buttonWidget != NULL ) {
    257 					buttonWidget->SetDescription( "#str_02213" );
    258 				}
    259 				index++;
    260 				options->GetChildByIndex( index ).ClearEventActions();
    261 				options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_SETTINGS );
    262 				buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    263 				if ( buttonWidget != NULL ) {
    264 					buttonWidget->SetDescription( "#str_02206" );
    265 				}
    266 				index++;
    267 				options->GetChildByIndex( index ).ClearEventActions();
    268 				options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_EXIT );
    269 				buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    270 				if ( buttonWidget != NULL ) {
    271 					buttonWidget->SetDescription( "#str_swf_exit_game_desc" );
    272 				}
    273 
    274 			} else {
    275 				option.Append( "#str_04106" );	// return to game
    276 				menuOptions.Append( option );
    277 				option.Clear();
    278 				option.Append( "#str_02179" );	// save game
    279 				menuOptions.Append( option );	
    280 				option.Clear();
    281 				option.Append( "#str_02187" );	// load game
    282 				menuOptions.Append( option );
    283 				option.Clear();
    284 				option.Append( "#str_swf_settings" );	// settings
    285 				menuOptions.Append( option );
    286 				option.Clear();
    287 				option.Append( "#str_swf_exit_game" );	// exit game
    288 				menuOptions.Append( option );
    289 
    290 				int index = 0;
    291 				idMenuWidget_Button * buttonWidget = NULL;
    292 				options->GetChildByIndex( index ).ClearEventActions();
    293 				options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_RETURN );
    294 				buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    295 				if ( buttonWidget != NULL ) {
    296 					buttonWidget->SetDescription( "#str_swf_resume_desc" );
    297 				}
    298 				index++;
    299 				options->GetChildByIndex( index ).ClearEventActions();
    300 				options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_SAVE );
    301 				buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    302 				if ( buttonWidget != NULL ) {
    303 					buttonWidget->SetDescription( "#str_02211" );
    304 				}
    305 				index++;
    306 				options->GetChildByIndex( index ).ClearEventActions();
    307 				options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_LOAD );
    308 				buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    309 				if ( buttonWidget != NULL ) {
    310 					buttonWidget->SetDescription( "#str_02213" );
    311 				}
    312 				index++;
    313 				options->GetChildByIndex( index ).ClearEventActions();
    314 				options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_SETTINGS );
    315 				buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    316 				if ( buttonWidget != NULL ) {
    317 					buttonWidget->SetDescription( "#str_02206" );
    318 				}
    319 				index++;
    320 				options->GetChildByIndex( index ).ClearEventActions();
    321 				options->GetChildByIndex( index ).AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, PAUSE_CMD_EXIT );
    322 				buttonWidget = dynamic_cast< idMenuWidget_Button * >( &options->GetChildByIndex( index ) );
    323 				if ( buttonWidget != NULL ) {
    324 					buttonWidget->SetDescription( "#str_swf_exit_game_desc" );
    325 				}
    326 			}
    327 		}
    328 	}
    329 	
    330 	options->SetListData( menuOptions );
    331 	idMenuScreen::ShowScreen( transitionType );
    332 
    333 	if ( options->GetFocusIndex() >= menuOptions.Num() ) {
    334 		options->SetViewIndex( 0 );
    335 		options->SetFocusIndex( 0 );
    336 	}
    337 
    338 }
    339 
    340 /*
    341 ========================
    342 idMenuScreen_Shell_Pause::HideScreen
    343 ========================
    344 */
    345 void idMenuScreen_Shell_Pause::HideScreen( const mainMenuTransition_t transitionType ) {
    346 	idMenuScreen::HideScreen( transitionType );
    347 }
    348 
    349 /*
    350 ========================
    351 idMenuScreen_Shell_Pause::HandleExitGameBtn
    352 ========================
    353 */
    354 void idMenuScreen_Shell_Pause::HandleExitGameBtn() {
    355 	class idSWFScriptFunction_QuitDialog : public idSWFScriptFunction_RefCounted {
    356 	public:
    357 		idSWFScriptFunction_QuitDialog( idMenuScreen_Shell_Pause * _menu, gameDialogMessages_t _msg, bool _accept ) {
    358 			menu = _menu;
    359 			msg = _msg;
    360 			accept = _accept;
    361 		}
    362 		idSWFScriptVar Call( idSWFScriptObject * thisObject, const idSWFParmList & parms ) {
    363 			common->Dialog().ClearDialog( msg );
    364 			if ( accept ) {
    365 				cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "disconnect\n" );
    366 			}
    367 			return idSWFScriptVar();
    368 		}
    369 	private:
    370 		idMenuScreen_Shell_Pause * menu;
    371 		gameDialogMessages_t msg;
    372 		bool accept;
    373 	};
    374 
    375 	gameDialogMessages_t msg = GDM_SP_QUIT_SAVE;
    376 
    377 	if ( common->IsMultiplayer() ) {
    378 		if ( ( session->GetGameLobbyBase().GetNumLobbyUsers() > 1 ) && MatchTypeHasStats( session->GetGameLobbyBase().GetMatchParms().matchFlags ) ) {
    379 			msg = GDM_MULTI_VDM_QUIT_LOSE_LEADERBOARDS;
    380 		} else {
    381 			msg = GDM_MULTI_VDM_QUIT;
    382 		}
    383 	}
    384 
    385 	common->Dialog().AddDialog( msg, DIALOG_ACCEPT_CANCEL, new idSWFScriptFunction_QuitDialog( this, msg, true ), new idSWFScriptFunction_QuitDialog( this, msg, false ), false );
    386 }
    387 
    388 /*
    389 ========================
    390 idMenuScreen_Shell_Pause::HandleRestartBtn
    391 ========================
    392 */
    393 void idMenuScreen_Shell_Pause::HandleRestartBtn() {
    394 	class idSWFScriptFunction_RestartDialog : public idSWFScriptFunction_RefCounted {
    395 	public:
    396 		idSWFScriptFunction_RestartDialog( idMenuScreen_Shell_Pause * _menu, gameDialogMessages_t _msg, bool _accept ) {
    397 			menu = _menu;
    398 			msg = _msg;
    399 			accept = _accept;
    400 		}
    401 		idSWFScriptVar Call( idSWFScriptObject * thisObject, const idSWFParmList & parms ) {
    402 			common->Dialog().ClearDialog( msg );
    403 			if ( accept ) {
    404 				cmdSystem->AppendCommandText( "restartMap\n" );
    405 			}
    406 			return idSWFScriptVar();
    407 		}
    408 	private:
    409 		idMenuScreen_Shell_Pause * menu;
    410 		gameDialogMessages_t msg;
    411 		bool accept;
    412 	};
    413 
    414 	common->Dialog().AddDialog( GDM_SP_RESTART_SAVE, DIALOG_ACCEPT_CANCEL, new idSWFScriptFunction_RestartDialog( this, GDM_SP_RESTART_SAVE, true ), new idSWFScriptFunction_RestartDialog( this, GDM_SP_RESTART_SAVE, false ), false );
    415 }
    416 
    417 /*
    418 ========================
    419 idMenuScreen_Shell_Pause::HandleAction
    420 ========================
    421 */
    422 bool idMenuScreen_Shell_Pause::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
    423 
    424 	if ( menuData == NULL ) {
    425 		return true;
    426 	}
    427 
    428 	if ( menuData->ActiveScreen() != SHELL_AREA_ROOT ) {
    429 		return false;
    430 	}
    431 
    432 	widgetAction_t actionType = action.GetType();
    433 	const idSWFParmList & parms = action.GetParms();
    434 
    435 	switch ( actionType ) {
    436 		case WIDGET_ACTION_COMMAND: {
    437 			switch ( parms[0].ToInteger() ) {
    438 				case PAUSE_CMD_RESTART: {
    439 					HandleRestartBtn();
    440 					break;
    441 				}
    442 				case PAUSE_CMD_DEAD_RESTART: {
    443 					cmdSystem->AppendCommandText( "restartMap\n" );
    444 					break;
    445 				}
    446 				case PAUSE_CMD_SETTINGS: {
    447 					menuData->SetNextScreen( SHELL_AREA_SETTINGS, MENU_TRANSITION_SIMPLE );
    448 					break;
    449 				}
    450 				case PAUSE_CMD_LEAVE:
    451 				case PAUSE_CMD_EXIT: {
    452 					HandleExitGameBtn();
    453 					break;
    454 				}
    455 				case PAUSE_CMD_RETURN: {
    456 					menuData->SetNextScreen( SHELL_AREA_INVALID, MENU_TRANSITION_SIMPLE );
    457 					break;
    458 				}
    459 				case PAUSE_CMD_LOAD: {
    460 					menuData->SetNextScreen( SHELL_AREA_LOAD, MENU_TRANSITION_SIMPLE );
    461 					break;
    462 				}
    463 				case PAUSE_CMD_SAVE: {
    464 					menuData->SetNextScreen( SHELL_AREA_SAVE, MENU_TRANSITION_SIMPLE );
    465 					break;
    466 				}
    467 				case PAUSE_CMD_PS3: {
    468 					menuData->SetNextScreen( SHELL_AREA_PLAYSTATION, MENU_TRANSITION_SIMPLE );
    469 					break;
    470 				}
    471 				case PAUSE_CMD_INVITE_FRIENDS: {
    472 					session->InviteFriends();
    473 					break;
    474 				}
    475 			}
    476 			return true;
    477 		}
    478 	}
    479 
    480 	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
    481 }