From: Ketmar Dark Date: Sat, 2 Sep 2017 18:59:15 +0000 (+0300) Subject: F3 at titlepic/menu will show "load game" dialog: bugfix X-Git-Url: https://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=commitdiff_plain;h=4fd037a0be973a453413bf6077ddbf0e5a8df356 F3 at titlepic/menu will show "load game" dialog: bugfix --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 2d1c41a..9ec9639 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -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; diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 85334b3..93666fa 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -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');