improved changing back and forth from: editor menus <-> main menus
This commit is contained in:
parent
e127331545
commit
4085cf40e2
3 changed files with 14 additions and 12 deletions
src
|
@ -250,6 +250,7 @@ typedef struct _menus_ {
|
|||
-- Variables
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
extern int GuiGameStarted; /// Game Started?
|
||||
extern Menu *CurrentMenu; /// Currently processed menu
|
||||
extern char ScenSelectFullPath[1024]; /// Full path to currently selected map
|
||||
extern MapInfo *ScenSelectPudInfo; /// MapInfo of currently selected map
|
||||
|
|
|
@ -1022,14 +1022,16 @@ global void MenuLoop(char* filename, WorldMap* map)
|
|||
PlayMusic(MenuMusic);
|
||||
}
|
||||
EnableRedraw=RedrawMenu;
|
||||
if( EditorRunning ) {
|
||||
QuitToMenu = 0;
|
||||
ProcessMenu("menu-editor-select", 1);
|
||||
if (QuitToMenu)
|
||||
return;
|
||||
} else {
|
||||
ProcessMenu("menu-program-start", 1);
|
||||
|
||||
GuiGameStarted = 0;
|
||||
while (GuiGameStarted == 0) {
|
||||
if( EditorRunning ) {
|
||||
ProcessMenu("menu-editor-select", 1);
|
||||
} else {
|
||||
ProcessMenu("menu-program-start", 1);
|
||||
}
|
||||
}
|
||||
|
||||
EnableRedraw=RedrawEverything;
|
||||
DebugLevel0Fn("Menu start: NetPlayers %d\n" _C_ NetPlayers);
|
||||
filename = CurrentMapPath;
|
||||
|
|
|
@ -325,7 +325,7 @@ global _MenuFuncHash MenuFuncHash;
|
|||
extern char NameLine[];
|
||||
|
||||
local int GameLoaded;
|
||||
local int GuiGameStarted;
|
||||
global int GuiGameStarted = 0;
|
||||
local int EditorCancelled;
|
||||
|
||||
/**
|
||||
|
@ -4657,7 +4657,7 @@ local void StartEditor(void)
|
|||
}
|
||||
|
||||
EditorRunning = 1;
|
||||
MenuLoop(NULL, &TheMap);
|
||||
EndMenu();
|
||||
}
|
||||
|
||||
local void CancelEditorSelect(void)
|
||||
|
@ -4722,6 +4722,7 @@ local void EditorNewMap(void)
|
|||
|
||||
*CurrentMapPath = '\0';
|
||||
|
||||
GuiGameStarted = 1;
|
||||
EndMenu();
|
||||
}
|
||||
|
||||
|
@ -4845,9 +4846,7 @@ local void EditorMainLoadMap(void)
|
|||
strcpy(CurrentMapPath, ScenSelectFileName);
|
||||
}
|
||||
|
||||
// FIXME: Use EditorRunning and main-loop.
|
||||
EditorRunning=1;
|
||||
EditorMainLoop();
|
||||
GuiGameStarted = 1;
|
||||
EndMenu();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue