Addition to the menu fixes.
Add two places I missed before, and simplify the code a bit. git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@11013 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
8b84053cba
commit
00d3899eb4
|
@ -74,13 +74,14 @@
|
|||
// 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];
|
||||
static char textureSize[WIDG_MAXSTR];
|
||||
|
||||
tMode titleMode; // the global case
|
||||
tMode lastTitleMode; // Since skirmish and multiplayer setup use the same functions, we use this to go back to the corresponding menu.
|
||||
|
||||
char aLevelName[MAX_LEVEL_NAME_SIZE+1]; //256]; // vital! the wrf file to use.
|
||||
|
||||
BOOL bLimiterLoaded = false;
|
||||
|
@ -463,7 +464,7 @@ BOOL runSinglePlayerMenu(void)
|
|||
|
||||
case FRONTEND_SKIRMISH:
|
||||
ingame.bHostSetup = true;
|
||||
multiplayersetup = false;
|
||||
lastTitleMode = SINGLE;
|
||||
changeTitleMode(MULTIOPTION);
|
||||
break;
|
||||
|
||||
|
@ -536,7 +537,7 @@ BOOL runMultiPlayerMenu(void)
|
|||
bMultiPlayer = true;
|
||||
bMultiMessages = true;
|
||||
game.type = SKIRMISH; // needed?
|
||||
multiplayersetup = true;
|
||||
lastTitleMode = MULTI;
|
||||
changeTitleMode(MULTIOPTION);
|
||||
break;
|
||||
case FRONTEND_JOIN:
|
||||
|
@ -901,7 +902,7 @@ BOOL runGameOptions3Menu(void)
|
|||
|
||||
// If close button pressed then return from this menu.
|
||||
if(CancelPressed()) {
|
||||
changeTitleMode(TITLE);
|
||||
changeTitleMode(OPTIONS);
|
||||
}
|
||||
|
||||
widgDisplayScreen(psWScreen); // show the widgets currently running
|
||||
|
|
|
@ -54,8 +54,7 @@ typedef enum _title_mode {
|
|||
} tMode;
|
||||
|
||||
extern tMode titleMode; // the global case
|
||||
|
||||
extern bool multiplayersetup;
|
||||
extern tMode lastTitleMode;
|
||||
|
||||
#define DEFAULT_LEVEL "CAM_1A"
|
||||
#define TUTORIAL_LEVEL "TUTORIAL3"
|
||||
|
|
|
@ -889,6 +889,11 @@ FAIL:
|
|||
iV_SetFont(font_large);
|
||||
iV_DrawText(_("Searching"), D_W+260, D_H+460);
|
||||
}
|
||||
|
||||
if (CancelPressed())
|
||||
{
|
||||
changeTitleMode(PROTOCOL);
|
||||
}
|
||||
}
|
||||
|
||||
// Used to draw the password box for the lobby screen
|
||||
|
@ -2216,14 +2221,7 @@ static void stopJoining(void)
|
|||
return;
|
||||
}
|
||||
debug(LOG_NET, "We have stopped joining.");
|
||||
if (multiplayersetup)
|
||||
{
|
||||
changeTitleMode(MULTI);
|
||||
}
|
||||
else
|
||||
{
|
||||
changeTitleMode(SINGLE);
|
||||
}
|
||||
changeTitleMode(lastTitleMode);
|
||||
selectedPlayer = 0;
|
||||
|
||||
if (ingame.bHostSetup)
|
||||
|
@ -3148,14 +3146,7 @@ void runMultiOptions(void)
|
|||
|
||||
if (CancelPressed())
|
||||
{
|
||||
if (multiplayersetup)
|
||||
{
|
||||
changeTitleMode(MULTI);
|
||||
}
|
||||
else
|
||||
{
|
||||
changeTitleMode(SINGLE);
|
||||
}
|
||||
changeTitleMode(lastTitleMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue