From ca68fe630b0161d8b1680448774080158fc83493 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 19 May 2023 22:15:56 +0100 Subject: [PATCH] Show PAUSED image when the game is stopped by the pause command In addition, don't show the pause menu PAUSED in modeattacking/netgames This text is now snapto-affected, since we can't (or at least shouldn't) summon the widescreen border in regular pause instances. --- src/d_main.c | 19 ------------------- src/k_menudraw.c | 32 +++++++++++++++++++++----------- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 1d07c9298..1b562b238 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -659,25 +659,6 @@ static void D_Display(void) if (forcerefresh && G_GamestateUsesLevel() == false) V_SetPalette(0); - // draw pause pic - if (paused && cv_showhud.value && !demo.playback) - { -#if 0 - INT32 py; - patch_t *patch; - if (automapactive) - py = 4; - else - py = viewwindowy + 4; - patch = W_CachePatchName("M_PAUSE", PU_PATCH); - V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - patch->width)/2, py, 0, patch); -#else - INT32 y = ((automapactive) ? (32) : (BASEVIDHEIGHT/2)); - M_DrawTextBox((BASEVIDWIDTH/2) - (60), y - (16), 13, 2); - V_DrawCenteredString(BASEVIDWIDTH/2, y - (4), V_YELLOWMAP, "Game Paused"); -#endif - } - if (demo.rewinding) V_DrawFadeScreen(TC_RAINBOW, (leveltime & 0x20) ? SKINCOLOR_PASTEL : SKINCOLOR_MOONSET); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 0f9307f4e..0762ad88e 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -578,6 +578,16 @@ void M_DrawMenuMessage(void) } } +// PAUSE +static void M_DrawPausedText(INT32 x) +{ + patch_t *pausebg = W_CachePatchName("M_STRIPU", PU_CACHE); + patch_t *pausetext = W_CachePatchName("M_PAUSET", PU_CACHE); + + V_DrawFixedPatch(x, 0, FRACUNIT, V_SNAPTOLEFT|V_SNAPTOTOP|V_ADD, pausebg, NULL); + V_DrawFixedPatch(x, 0, FRACUNIT, V_SNAPTOLEFT|V_SNAPTOTOP, pausetext, NULL); +} + // // M_Drawer // Called after the view has been rendered, @@ -637,14 +647,17 @@ void M_Drawer(void) menuwipe = false; } + // draw pause pic + if (paused && !demo.playback && (menuactive || cv_showhud.value)) + { + M_DrawPausedText(0); + } + // focus lost notification goes on top of everything, even the former everything if (window_notinfocus && cv_showfocuslost.value) { M_DrawTextBox((BASEVIDWIDTH/2) - (60), (BASEVIDHEIGHT/2) - (16), 13, 2); - if (gamestate == GS_LEVEL && (P_AutoPause() || paused)) - V_DrawCenteredString(BASEVIDWIDTH/2, (BASEVIDHEIGHT/2) - (4), highlightflags, "Game Paused"); - else - V_DrawCenteredString(BASEVIDWIDTH/2, (BASEVIDHEIGHT/2) - (4), highlightflags, "Focus Lost"); + V_DrawCenteredString(BASEVIDWIDTH/2, (BASEVIDHEIGHT/2) - (4), highlightflags, "Focus Lost"); } } @@ -4024,8 +4037,6 @@ void M_DrawExtras(void) // INGAME / PAUSE MENUS // -// PAUSE - // PAUSE MAIN MENU void M_DrawPause(void) { @@ -4046,18 +4057,17 @@ void M_DrawPause(void) INT16 word2len = 0; boolean sok = false; - patch_t *pausebg = W_CachePatchName("M_STRIPU", PU_CACHE); patch_t *vertbg = W_CachePatchName("M_STRIPV", PU_CACHE); - patch_t *pausetext = W_CachePatchName("M_PAUSET", PU_CACHE); - patch_t *arrstart = W_CachePatchName("M_PTIP", PU_CACHE); patch_t *arrfill = W_CachePatchName("M_PFILL", PU_CACHE); //V_DrawFadeScreen(0xFF00, 16); // "PAUSED" - V_DrawFixedPatch(-offset*FRACUNIT, 0, FRACUNIT, V_ADD, pausebg, NULL); - V_DrawFixedPatch(-offset*FRACUNIT, 0, FRACUNIT, 0, pausetext, NULL); + if (!paused && !demo.playback && !modeattacking && !netgame) // as close to possible as P_AutoPause, but not dependent on menuactive + { + M_DrawPausedText(-offset*FRACUNIT); + } // Vertical Strip: V_DrawFixedPatch((230 + offset)<