improved changing back and forth from: editor menus <-> main menus

This commit is contained in:
nehalmistry 2002-11-27 16:10:31 +00:00
parent e127331545
commit 4085cf40e2
3 changed files with 14 additions and 12 deletions
src

View file

@ -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

View file

@ -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;

View file

@ -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();
}