Fixes by rftr:

- options screen: fixed crash related to handling inputs while the screen was loading/refreshing
- options screen and features screen: added 'Q' input handling to quit to the main menu

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9235 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2022-01-05 09:26:29 +00:00
parent 6a3f5cf29e
commit f986129ab7
2 changed files with 24 additions and 2 deletions
+17 -2
View File
@@ -81,6 +81,7 @@ INT32 giOptionsMessageBox = -1; // Options pop up messages index value
INT8 gbHighLightedOptionText = -1;
BOOLEAN gfOptionsScreenUnloading = FALSE;
//BOOLEAN gfHideBloodAndGoreOption=FALSE; //all this blood gore option enforcment is unused
//If a germany build we are to hide the blood and gore option
@@ -226,11 +227,13 @@ UINT32 OptionsScreenHandle()
BlitBufferToBuffer( guiRENDERBUFFER, guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
else
{
GetOptionsScreenUserInput();
}
RestoreBackgroundRects();
GetOptionsScreenUserInput();
HandleOptionsScreen();
if( gfRedrawOptionsScreen )
@@ -759,11 +762,16 @@ BOOLEAN EnterOptionsScreen()
gfSettingOfDontAnimateSmoke = gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ];
gfSettingOfTacticalFaceIcon = gGameSettings.fOptions[ TOPTION_SHOW_TACTICAL_FACE_ICONS ];
gfOptionsScreenUnloading = FALSE;
return( TRUE );
}
void ExitOptionsScreen()
{
if (gfOptionsScreenUnloading == TRUE)
return;
gfOptionsScreenUnloading = TRUE;
if( gfExitOptionsDueToMessageBox )
{
@@ -963,6 +971,13 @@ void GetOptionsScreenUserInput()
{
switch( Event.usParam )
{
case 'q':
case 'Q':
//Confirm the Exit to the main menu screen
DoOptionsMessageBox( MSG_BOX_BASIC_STYLE, zOptionsText[OPT_RETURN_TO_MAIN], OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO,
ConfirmQuitToMainMenuMessageBoxCallBack );
break;
case ESC:
SetOptionsExitScreen( guiPreviousOptionScreen );
break;