Fix menu navigation.

Always go back to the previous menu, also when pressing escape.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@11008 4a71c877-e1ca-e34f-864e-861f7616d084
master
Christian Ohm 2010-06-20 23:51:52 +00:00 committed by Git SVN Gateway
parent 5a15ae67cc
commit 8b84053cba
4 changed files with 42 additions and 3 deletions

View File

@ -74,6 +74,7 @@
// Global variables
static int StartWithGame = 1; // New game starts in Cam 1.
bool multiplayersetup = false; // Skirmish or multiplayer setup? Used to go back to the corresponding menu.
// Widget code and non-constant strings do not get along
static char resolution[WIDG_MAXSTR];
@ -462,6 +463,7 @@ BOOL runSinglePlayerMenu(void)
case FRONTEND_SKIRMISH:
ingame.bHostSetup = true;
multiplayersetup = false;
changeTitleMode(MULTIOPTION);
break;
@ -534,6 +536,7 @@ BOOL runMultiPlayerMenu(void)
bMultiPlayer = true;
bMultiMessages = true;
game.type = SKIRMISH; // needed?
multiplayersetup = true;
changeTitleMode(MULTIOPTION);
break;
case FRONTEND_JOIN:
@ -554,6 +557,11 @@ BOOL runMultiPlayerMenu(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
if (CancelPressed())
{
changeTitleMode(TITLE);
}
return true;
}
@ -1431,7 +1439,7 @@ BOOL runGameOptionsMenu(void)
// If close button pressed then return from this menu.
if(CancelPressed()) {
changeTitleMode(TITLE);
changeTitleMode(OPTIONS);
}
widgDisplayScreen(psWScreen); // show the widgets currently running

View File

@ -55,6 +55,8 @@ typedef enum _title_mode {
extern tMode titleMode; // the global case
extern bool multiplayersetup;
#define DEFAULT_LEVEL "CAM_1A"
#define TUTORIAL_LEVEL "TUTORIAL3"

View File

@ -237,7 +237,7 @@ BOOL runKeyMapEditor(void)
if(id == KM_RETURN) // return
{
saveKeyMap();
changeTitleMode(TITLE);
changeTitleMode(OPTIONS);
}
if(id == KM_DEFAULT)
{
@ -262,6 +262,11 @@ BOOL runKeyMapEditor(void)
widgDisplayScreen(psWScreen); // show the widgets currently running
if (CancelPressed())
{
changeTitleMode(OPTIONS);
}
return true;
}

View File

@ -592,6 +592,11 @@ void runConnectionScreen(void )
{
widgDisplayScreen(psConScreen); // show the widgets currently running
}
if (CancelPressed())
{
changeTitleMode(MULTI);
}
}
// ////////////////////////////////////////////////////////////////////////
@ -2211,7 +2216,14 @@ static void stopJoining(void)
return;
}
debug(LOG_NET, "We have stopped joining.");
changeTitleMode(TITLE); // Go back to top level menu
if (multiplayersetup)
{
changeTitleMode(MULTI);
}
else
{
changeTitleMode(SINGLE);
}
selectedPlayer = 0;
if (ingame.bHostSetup)
@ -3133,6 +3145,18 @@ void runMultiOptions(void)
iV_SetFont(font_regular); // switch to small font.
displayConsoleMessages(); // draw the chatbox
}
if (CancelPressed())
{
if (multiplayersetup)
{
changeTitleMode(MULTI);
}
else
{
changeTitleMode(SINGLE);
}
}
}
BOOL startMultiOptions(BOOL bReenter)