Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
Main: Show game menu in intermissions
Browse files Browse the repository at this point in the history
TODO:
- Store game state in saved files (for single/custom games with
intermission)
- Don't send enter key to intermission when saving game
  • Loading branch information
binarymaster committed Dec 30, 2015
1 parent bba3e44 commit 5171bf5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
12 changes: 9 additions & 3 deletions DF Sources/g_game.pas
Expand Up @@ -2293,6 +2293,9 @@ procedure g_Game_Draw();
e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);

DrawCustomStat();

if g_ActiveWindow <> nil then
e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
end;

if gState = STATE_INTERSINGLE then
Expand All @@ -2309,6 +2312,9 @@ procedure g_Game_Draw();
e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);

DrawSingleStat();

if g_ActiveWindow <> nil then
e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
end;
end;

Expand All @@ -2322,6 +2328,9 @@ procedure g_Game_Draw();
e_DrawSize(ID, 0, 0, 0, False, False, gScreenWidth, gScreenHeight)
else
e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);

if g_ActiveWindow <> nil then
e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
end;

if gState = STATE_SLIST then
Expand Down Expand Up @@ -4625,9 +4634,6 @@ procedure g_TakeScreenShot();

procedure g_Game_InGameMenu(Show: Boolean);
begin
if not gGameOn then
Exit;

if (g_ActiveWindow = nil) and Show then
begin
if gGameSettings.GameType = GT_SINGLE then
Expand Down
42 changes: 23 additions & 19 deletions DF Sources/g_main.pas
Expand Up @@ -330,7 +330,7 @@ procedure KeyPress(K: Byte);
if (g_ActiveWindow = nil) then
g_Game_Pause(not gPause);
end;

192: // <`/~/¸/¨>:
begin
g_Console_Switch();
Expand All @@ -343,7 +343,7 @@ procedure KeyPress(K: Byte);
g_Console_Chat_Switch();
Exit;
end;

if gConsoleShow then // Óáðàòü êîíñîëü
g_Console_Switch()
else
Expand All @@ -354,23 +354,27 @@ procedure KeyPress(K: Byte);
g_ActiveWindow.OnMessage(Msg);
end
else
if gGameOn then // Âîéòè âî âíóòðèèãðîâîå ìåíþ
g_Game_InGameMenu(True)
else
if (gExit = 0) then
begin // Âîéòè â ãëàâíîå ìåíþ
if gState <> STATE_MENU then
if NetMode <> NET_NONE then
begin
g_Game_StopAllSounds(True);
g_Game_Free;
gState := STATE_MENU;
Exit;
end;

g_GUI_ShowWindow('MainMenu');
g_Sound_PlayEx('MENU_OPEN');
end;
if gState <> STATE_FOLD then // Íå âûõîäèòü â ìåíþ ïðè çàòóõàíèè
if gGameOn
or (gState = STATE_INTERSINGLE)
or (gState = STATE_INTERCUSTOM)
then // Âîéòè âî âíóòðèèãðîâîå ìåíþ
g_Game_InGameMenu(True)
else
if (gExit = 0) then
begin // Âîéòè â ãëàâíîå ìåíþ
if gState <> STATE_MENU then
if NetMode <> NET_NONE then
begin
g_Game_StopAllSounds(True);
g_Game_Free;
gState := STATE_MENU;
Exit;
end;

g_GUI_ShowWindow('MainMenu');
g_Sound_PlayEx('MENU_OPEN');
end;
end;

VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F10:
Expand Down

0 comments on commit 5171bf5

Please sign in to comment.