DEADSOFTWARE

F3 at titlepic/menu will show "load game" dialog: bugfix
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 2 Sep 2017 18:59:15 +0000 (21:59 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 2 Sep 2017 19:36:15 +0000 (22:36 +0300)
src/game/g_game.pas
src/game/g_menu.pas

index 2d1c41a7c17db93ea5e910d6c87bd8456fa31422..9ec96396134f776058e72cb7616103bd7a116501 100644 (file)
@@ -3229,7 +3229,7 @@ begin
         else e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);
       end;
       // F3 at menu will show game loading dialog
-      if e_KeyPressed(IK_F3) then g_Menu_Show_LoadMenu();
+      if e_KeyPressed(IK_F3) then g_Menu_Show_LoadMenu(true);
       if (g_ActiveWindow <> nil) then
       begin
         //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
@@ -3240,7 +3240,7 @@ begin
         // F3 at titlepic will show game loading dialog
         if e_KeyPressed(IK_F3) then
         begin
-          g_Menu_Show_LoadMenu();
+          g_Menu_Show_LoadMenu(true);
           if (g_ActiveWindow <> nil) then e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
         end;
       end;
index 85334b3bf14b8331ed5c2bc114266c667a0db93f..93666fa87f3f4f4a9da3c5fe71a195b871af8533 100644 (file)
@@ -26,7 +26,7 @@ procedure LoadFont(txtres, fntres: string; var FontID: DWORD);
 procedure g_Menu_AskLanguage();
 
 procedure g_Menu_Show_SaveMenu();
-procedure g_Menu_Show_LoadMenu();
+procedure g_Menu_Show_LoadMenu(standalone: Boolean=false);
 procedure g_Menu_Show_GameSetGame();
 procedure g_Menu_Show_OptionsVideo();
 procedure g_Menu_Show_OptionsSound();
@@ -3088,19 +3088,18 @@ begin
   g_Sound_PlayEx('MENU_OPEN');
 end;
 
-procedure g_Menu_Show_LoadMenu();
+procedure g_Menu_Show_LoadMenu (standalone: Boolean=false);
 begin
+  if (g_ActiveWindow <> nil) and (g_ActiveWindow.name = 'LoadMenu') then exit; // nothing to do
   if gGameSettings.GameType = GT_SINGLE then
-    g_GUI_ShowWindow('GameSingleMenu')
+  begin
+    if not standalone then g_GUI_ShowWindow('GameSingleMenu')
+  end
   else
   begin
-    if g_Game_IsClient then
-      Exit
-    else
-      if g_Game_IsNet then
-        Exit
-      else
-        g_GUI_ShowWindow('GameCustomMenu');
+    if g_Game_IsClient then exit;
+    if g_Game_IsNet then exit;
+    if not standalone then g_GUI_ShowWindow('GameCustomMenu');
   end;
   g_GUI_ShowWindow('LoadMenu');
   g_Sound_PlayEx('MENU_OPEN');