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-861f7616d084master
parent
5a15ae67cc
commit
8b84053cba
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue