From d4c6c7585835de52110f270dd5de18431579b689 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Sep 2023 15:20:46 +0100 Subject: [PATCH 1/8] Y_DrawIntermissionButton - The (A) that appears on the intermission to permit you to skip it now has its own drawer function. - This drawer (interpolatedly) slides it in and out depending on the two times passed to it. - Now slides in at the first half-second of intermission, preventing mashing through. --- src/y_inter.c | 86 ++++++++++++++++++++++++++++++++++++++++++++------- src/y_inter.h | 1 + 2 files changed, 76 insertions(+), 11 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index d3a26e164..e0d1008da 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1349,6 +1349,67 @@ void Y_RoundQueueDrawer(y_data_t *standings, INT32 offset, boolean doanimations, } } +#define INTERBUTTONSLIDEIN (TICRATE/2) + +// +// Y_DrawIntermissionButton +// +// It's a button that slides at the given time +// +void Y_DrawIntermissionButton(INT32 startslide, INT32 through) +{ + INT32 percentslide = 0; + const INT32 slidetime = (TICRATE/4); + boolean pressed = false; + + if (startslide >= 0) + { + through = startslide; + } + else + { + through -= ((TICRATE/2) + 1); + pressed = (!menuactive && M_MenuConfirmHeld(0)); + } + + if (through >= 0) + { + if (through >= slidetime) + { + percentslide = FRACUNIT; + } + else + { + percentslide = R_InterpolateFixed( + (through - 1) * FRACUNIT, + (through * FRACUNIT) + ) / slidetime; + } + } + + if (percentslide < FRACUNIT) + { + INT32 offset = 0; + + if (percentslide) + { + offset = Easing_InCubic( + percentslide, + 0, + 16 * FRACUNIT + ); + } + + K_drawButton( + 2*FRACUNIT - offset, + (BASEVIDHEIGHT - 16)*FRACUNIT, + 0, + kp_button_a[1], + pressed + ); + } +} + // // Y_IntermissionDrawer // @@ -1541,13 +1602,7 @@ finalcounter: if (Y_CanSkipIntermission()) { - K_drawButton( - 2*FRACUNIT, - (BASEVIDHEIGHT - 16)*FRACUNIT, - 0, - kp_button_a[1], - M_MenuConfirmHeld(0) - ); + Y_DrawIntermissionButton(INTERBUTTONSLIDEIN - intertic, 3*TICRATE - timer); } else { @@ -1597,14 +1652,22 @@ void Y_Ticker(void) if (Y_CanSkipIntermission()) { - if (M_MenuConfirmPressed(0)) + if (intertic < INTERBUTTONSLIDEIN) + { + intertic++; + return; + } + + boolean preventintertic = (intertic == INTERBUTTONSLIDEIN); + + if (!menuactive && M_MenuConfirmPressed(0)) { // If there is a roundqueue, make time for it. // Else, end instantly on button press. // Actually, give it a slight delay, so the "kaching" sound isn't cut off. const tic_t end = roundqueue.size != 0 ? 3*TICRATE : TICRATE; - if (intertic == -1) // card flip hasn't started + if (intertic == INTERBUTTONSLIDEIN) // card flip hasn't started { if (sorttic != -1) { @@ -1612,9 +1675,10 @@ void Y_Ticker(void) } else { - intertic = 0; timer = end; } + + preventintertic = false; } else if (timer >= INFINITE_TIMER && intertic >= sorttic + 16) // card done flipping { @@ -1629,7 +1693,7 @@ void Y_Ticker(void) } } - if (intertic == -1) + if (preventintertic) { return; } diff --git a/src/y_inter.h b/src/y_inter.h index 6995023db..577ac78d1 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -51,6 +51,7 @@ void Y_Ticker(void); // Specific sub-drawers void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset); void Y_RoundQueueDrawer(y_data_t *standings, INT32 offset, boolean doanimations, boolean widescreen); +void Y_DrawIntermissionButton(INT32 startslide, INT32 through); void Y_StartIntermission(void); void Y_EndIntermission(void); From 40a79056fa4bd8f8a9d2a33d22e594f45cc9506c Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Sep 2023 15:22:38 +0100 Subject: [PATCH 2/8] Standard Evaluation: Delay the time the _DRIFT track starts to match the gainax shwing --- src/f_finale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index 247042185..8546266bf 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1263,7 +1263,7 @@ void F_GameEvaluationTicker(void) } else { - if (finalecount == 1) + if (finalecount == TICRATE/2) { // _drift across open waters Music_Remap("shore", "_DRIFT"); From 75900e4891f97ff3c7da714695f61ecad4b52a7b Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Sep 2023 15:25:31 +0100 Subject: [PATCH 3/8] Credits: Add the sliding intermission button for skipping Rules of skipping are slightly changed to match the slidein. - No skipping in the first two seconds - Automatically shuffles away once it gets to the end --- src/f_finale.c | 60 ++++++++++++++++++++++++++++++++++++++------------ src/g_game.c | 5 ----- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 8546266bf..080f42720 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -712,6 +712,7 @@ void F_StartCredits(void) finalecount = 0; animtimer = 0; timetonext = 2*TICRATE; + keypressed = false; } void F_CreditDrawer(void) @@ -769,6 +770,15 @@ void F_CreditDrawer(void) if (((y>>FRACBITS) * vid.dupy) > vid.height) break; } + + if (finalecount) + { + Y_DrawIntermissionButton(-1, (timetonext ? 5*TICRATE : TICRATE) - finalecount); + } + else + { + Y_DrawIntermissionButton(timetonext, 0); + } } void F_CreditTicker(void) @@ -805,18 +815,6 @@ void F_CreditTicker(void) break; } - // Do this here rather than in the drawer you doofus! (this is why dedicated mode broke at credits) - if (!credits[i] && y <= 120<everfinishedcredits = true; - if (M_UpdateUnlockablesAndExtraEmblems(true, true)) - G_SaveGameData(); - } - if (timetonext) timetonext--; else @@ -824,8 +822,39 @@ void F_CreditTicker(void) credbgtimer++; - if (finalecount && --finalecount == 0) - F_StartGameEvaluation(); + // Do this here rather than in the drawer you doofus! (this is why dedicated mode broke at credits) + + if (finalecount) + { + if (--finalecount == 0) + { + F_StartGameEvaluation(); + } + return; + } + + if (keypressed) + { + finalecount = TICRATE; + + if (netgame + && (server || IsPlayerAdmin(consoleplayer)) + ) + { + SendNetXCmd(XD_EXITLEVEL, NULL, 0); + return; + } + } + else if (!credits[i] && y <= 120<everfinishedcredits = true; + if (M_UpdateUnlockablesAndExtraEmblems(true, true)) + G_SaveGameData(); + } } boolean F_CreditResponder(event_t *event) @@ -881,6 +910,9 @@ boolean F_CreditResponder(event_t *event) if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE) return false; + if (timetonext) + return false; + if (keypressed) return true; diff --git a/src/g_game.c b/src/g_game.c index b01856ba2..4b6ff0a0b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1370,11 +1370,6 @@ boolean G_Responder(event_t *ev) if (F_CreditResponder(ev)) { - // Skip credits for everyone - if (! netgame) - F_StartGameEvaluation(); - else if (server || IsPlayerAdmin(consoleplayer)) - SendNetXCmd(XD_EXITLEVEL, NULL, 0); return true; } } From 94db9ac3a6774ea0e30f86031014f02b8a61c47e Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Sep 2023 15:28:30 +0100 Subject: [PATCH 4/8] Add skipping to Evaluation - Includes the sliding intermission button - Can only skip after the savedata has been updated - Always update the savedata at the same duration into the Evaluation --- src/f_finale.c | 83 +++++++++++++++++++++++++++++++++++++++++++------- src/f_finale.h | 1 + src/g_game.c | 13 ++++++++ 3 files changed, 86 insertions(+), 11 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 080f42720..8b920d0a1 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -933,8 +933,13 @@ typedef enum EVAL_MAX } evaluationtype_t; -#define EVALLEN_PERFECT (18*TICRATE) #define EVALLEN_NORMAL (14*TICRATE) +#define EVALLEN_HALFWAY (EVALLEN_NORMAL/2) + +// tyron made something perfect and i would sooner +// smite everyone in this room starting with myself +// over the idea of cutting it ~toast 250623 +#define EVALLEN_PERFECT (18*TICRATE) static evaluationtype_t evaluationtype; UINT16 finaleemeralds = 0; @@ -988,10 +993,13 @@ void F_StartGameEvaluation(void) else evaluationtype = EVAL_PERFECT; + timetonext = (evaluationtype == EVAL_PERFECT) ? EVALLEN_PERFECT : EVALLEN_NORMAL; + gameaction = ga_nothing; paused = false; CON_ToggleOff(); + keypressed = false; finalecount = -1; } @@ -1273,19 +1281,14 @@ void F_GameEvaluationDrawer(void) endingtext = va("%s, %s%s", skins[players[consoleplayer].skin].realname, rtatext, cuttext); V_DrawCenteredString(BASEVIDWIDTH/2, 182, V_SNAPTOBOTTOM|(ultimatemode ? V_REDMAP : V_YELLOWMAP), endingtext); } + + Y_DrawIntermissionButton(EVALLEN_HALFWAY + TICRATE - finalecount, (finalecount + TICRATE) - timetonext); } void F_GameEvaluationTicker(void) { - INT32 evallen = EVALLEN_NORMAL; - if (evaluationtype == EVAL_PERFECT) { - // tyron made something perfect and i would sooner - // smite everyone in this room starting with myself - // over the idea of cutting it ~toast 250623 - evallen = EVALLEN_PERFECT; - if (finalecount == 1) { // sitting on that distant _shore @@ -1303,13 +1306,13 @@ void F_GameEvaluationTicker(void) } } - if (++finalecount > evallen) + if (++finalecount == timetonext) { F_StartGameEnd(); return; } - if (finalecount == evallen/2) + if (finalecount == EVALLEN_HALFWAY) { if (!usedCheats) { @@ -1321,8 +1324,66 @@ void F_GameEvaluationTicker(void) } } -#undef EVALLEN_PERFECT +boolean F_EvaluationResponder(event_t *event) +{ + INT32 key = event->data1; + + // remap virtual keys (mouse & joystick buttons) + switch (key) + { + case KEY_MOUSE1: + key = KEY_ENTER; + break; + case KEY_MOUSE1 + 1: + key = KEY_BACKSPACE; + break; + case KEY_JOY1: + case KEY_JOY1 + 2: + key = KEY_ENTER; + break; + case KEY_JOY1 + 3: + key = 'n'; + break; + case KEY_JOY1 + 1: + key = KEY_BACKSPACE; + break; + case KEY_HAT1: + key = KEY_UPARROW; + break; + case KEY_HAT1 + 1: + key = KEY_DOWNARROW; + break; + case KEY_HAT1 + 2: + key = KEY_LEFTARROW; + break; + case KEY_HAT1 + 3: + key = KEY_RIGHTARROW; + break; + } + + if (event->type != ev_keydown) + return false; + + if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE) + return false; + + if (finalecount <= EVALLEN_HALFWAY + TICRATE) + return false; + + if (finalecount > (timetonext - TICRATE)) + return true; + + if (keypressed) + return true; + + keypressed = true; + timetonext = finalecount + TICRATE; + return true; +} + #undef EVALLEN_NORMAL +#undef EVALLEN_HALFWAY +#undef EVALLEN_PERFECT // ========== // GAME END diff --git a/src/f_finale.h b/src/f_finale.h index a40f98a48..f90bf567c 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -31,6 +31,7 @@ extern "C" { boolean F_IntroResponder(event_t *ev); boolean F_CutsceneResponder(event_t *ev); boolean F_CreditResponder(event_t *ev); +boolean F_EvaluationResponder(event_t *ev); // Called by main loop. void F_IntroTicker(void); diff --git a/src/g_game.c b/src/g_game.c index 4b6ff0a0b..85d7df1f7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1373,6 +1373,19 @@ boolean G_Responder(event_t *ev) return true; } } + else if (gamestate == GS_EVALUATION) + { + if (HU_Responder(ev)) + { + hu_keystrokes = true; + return true; // chat ate the event + } + + if (F_EvaluationResponder(ev)) + { + return true; + } + } else if (gamestate == GS_CEREMONY) { if (HU_Responder(ev)) From c46889c9244865e266fb0f02419db2d638395558 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Sep 2023 19:24:27 +0100 Subject: [PATCH 5/8] G_Responder: Call HU_Responder in Playing(), instead of a whitelisted set of gamestates Neatly sidesteps a class of bugs where whenever we added a new gamestate accessible in netplay, chat was console-only. --- src/g_game.c | 45 ++++++++------------------------------------- 1 file changed, 8 insertions(+), 37 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 85d7df1f7..2e9d47725 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1326,13 +1326,20 @@ boolean G_Responder(event_t *ev) return false; } - if (gamestate == GS_LEVEL) + if (Playing()) { + // If you're playing, chat is real. + // Neatly sidesteps a class of bugs where whenever we add a + // new gamestate accessible in netplay, chat was console-only. if (HU_Responder(ev)) { hu_keystrokes = true; return true; // chat ate the event } + } + + if (gamestate == GS_LEVEL) + { if (AM_Responder(ev)) return true; // automap ate it // map the event (key/mouse/joy) to a gamecontrol @@ -1348,12 +1355,6 @@ boolean G_Responder(event_t *ev) } else if (gamestate == GS_CUTSCENE) { - if (HU_Responder(ev)) - { - hu_keystrokes = true; - return true; // chat ate the event - } - if (F_CutsceneResponder(ev)) { D_StartTitle(); @@ -1362,12 +1363,6 @@ boolean G_Responder(event_t *ev) } else if (gamestate == GS_CREDITS) { - if (HU_Responder(ev)) - { - hu_keystrokes = true; - return true; // chat ate the event - } - if (F_CreditResponder(ev)) { return true; @@ -1375,12 +1370,6 @@ boolean G_Responder(event_t *ev) } else if (gamestate == GS_EVALUATION) { - if (HU_Responder(ev)) - { - hu_keystrokes = true; - return true; // chat ate the event - } - if (F_EvaluationResponder(ev)) { return true; @@ -1388,12 +1377,6 @@ boolean G_Responder(event_t *ev) } else if (gamestate == GS_CEREMONY) { - if (HU_Responder(ev)) - { - hu_keystrokes = true; - return true; // chat ate the event - } - if (K_CeremonyResponder(ev)) { if (grandprixinfo.gp == true @@ -1411,18 +1394,6 @@ boolean G_Responder(event_t *ev) return true; } } - else if (gamestate == GS_CONTINUING) - { - return true; - } - else if (gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_EVALUATION) - { - if (HU_Responder(ev)) - { - hu_keystrokes = true; - return true; // chat ate the event - } - } if (gamestate == GS_LEVEL && ev->type == ev_keydown && multiplayer && demo.playback && !demo.freecam) { From 4ad0beebb4b5bd71be4e74f4e88ada01f3f9b046 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Sep 2023 19:49:35 +0100 Subject: [PATCH 6/8] Credits and Evaluation: Replace dedicated Responder functions with Menu-style input processing The former method responded with an arbitrary approximation of standard inputs. This method benefits from the general-case stability of the Menu system to correctly parse triggers and other unique inputs. The only major consequence of this change is that ESC is no longer hardcoded to activate these. Otherwise, the game is cleaner for pure benefit. --- src/f_finale.c | 164 ++++++++++--------------------------------------- src/f_finale.h | 2 - src/g_game.c | 14 ----- 3 files changed, 33 insertions(+), 147 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 8b920d0a1..4b4c87941 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -824,6 +824,13 @@ void F_CreditTicker(void) // Do this here rather than in the drawer you doofus! (this is why dedicated mode broke at credits) + const boolean reachedbottom = (!credits[i] && y <= 120<everfinishedcredits = true; + if (M_UpdateUnlockablesAndExtraEmblems(true, true)) + G_SaveGameData(); + } + else if (timetonext) + ; + /*else if (!(gamedata->timesBeaten) && !(netgame || multiplayer) && !cht_debug) + ;*/ + else if (!menuactive && M_MenuConfirmPressed(0)) { finalecount = TICRATE; @@ -845,79 +865,6 @@ void F_CreditTicker(void) return; } } - else if (!credits[i] && y <= 120<everfinishedcredits = true; - if (M_UpdateUnlockablesAndExtraEmblems(true, true)) - G_SaveGameData(); - } -} - -boolean F_CreditResponder(event_t *event) -{ - INT32 key = event->data1; - - // remap virtual keys (mouse & joystick buttons) - switch (key) - { - case KEY_MOUSE1: - key = KEY_ENTER; - break; - case KEY_MOUSE1 + 1: - key = KEY_BACKSPACE; - break; - case KEY_JOY1: - case KEY_JOY1 + 2: - key = KEY_ENTER; - break; - case KEY_JOY1 + 3: - key = 'n'; - break; - case KEY_JOY1 + 1: - key = KEY_BACKSPACE; - break; - case KEY_HAT1: - key = KEY_UPARROW; - break; - case KEY_HAT1 + 1: - key = KEY_DOWNARROW; - break; - case KEY_HAT1 + 2: - key = KEY_LEFTARROW; - break; - case KEY_HAT1 + 3: - key = KEY_RIGHTARROW; - break; - } - - if (event->type != ev_keydown) - return false; - - if (key == KEY_DOWNARROW || key == KEY_SPACE) - { - if (!timetonext && !finalecount) - animtimer += 7; - return false; - } - - /*if (!(gamedata->timesBeaten) && !(netgame || multiplayer) && !cht_debug) - return false;*/ - - if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE) - return false; - - if (timetonext) - return false; - - if (keypressed) - return true; - - keypressed = true; - return true; } // ============ @@ -1312,6 +1259,18 @@ void F_GameEvaluationTicker(void) return; } + if (keypressed) + ; + else if (finalecount <= EVALLEN_HALFWAY + TICRATE) + ; + else if (finalecount >= (timetonext - TICRATE)) + ; + else if (!menuactive && M_MenuConfirmPressed(0)) + { + keypressed = true; + timetonext = finalecount + TICRATE; + } + if (finalecount == EVALLEN_HALFWAY) { if (!usedCheats) @@ -1324,63 +1283,6 @@ void F_GameEvaluationTicker(void) } } -boolean F_EvaluationResponder(event_t *event) -{ - INT32 key = event->data1; - - // remap virtual keys (mouse & joystick buttons) - switch (key) - { - case KEY_MOUSE1: - key = KEY_ENTER; - break; - case KEY_MOUSE1 + 1: - key = KEY_BACKSPACE; - break; - case KEY_JOY1: - case KEY_JOY1 + 2: - key = KEY_ENTER; - break; - case KEY_JOY1 + 3: - key = 'n'; - break; - case KEY_JOY1 + 1: - key = KEY_BACKSPACE; - break; - case KEY_HAT1: - key = KEY_UPARROW; - break; - case KEY_HAT1 + 1: - key = KEY_DOWNARROW; - break; - case KEY_HAT1 + 2: - key = KEY_LEFTARROW; - break; - case KEY_HAT1 + 3: - key = KEY_RIGHTARROW; - break; - } - - if (event->type != ev_keydown) - return false; - - if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE) - return false; - - if (finalecount <= EVALLEN_HALFWAY + TICRATE) - return false; - - if (finalecount > (timetonext - TICRATE)) - return true; - - if (keypressed) - return true; - - keypressed = true; - timetonext = finalecount + TICRATE; - return true; -} - #undef EVALLEN_NORMAL #undef EVALLEN_HALFWAY #undef EVALLEN_PERFECT diff --git a/src/f_finale.h b/src/f_finale.h index f90bf567c..517b59ce3 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -30,8 +30,6 @@ extern "C" { // Called by main loop. boolean F_IntroResponder(event_t *ev); boolean F_CutsceneResponder(event_t *ev); -boolean F_CreditResponder(event_t *ev); -boolean F_EvaluationResponder(event_t *ev); // Called by main loop. void F_IntroTicker(void); diff --git a/src/g_game.c b/src/g_game.c index 2e9d47725..3d218fdc9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1361,20 +1361,6 @@ boolean G_Responder(event_t *ev) return true; } } - else if (gamestate == GS_CREDITS) - { - if (F_CreditResponder(ev)) - { - return true; - } - } - else if (gamestate == GS_EVALUATION) - { - if (F_EvaluationResponder(ev)) - { - return true; - } - } else if (gamestate == GS_CEREMONY) { if (K_CeremonyResponder(ev)) From 62ab7bc0f9dee843b8ca558910cf59a02e472ab6 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Sep 2023 20:10:21 +0100 Subject: [PATCH 7/8] Move the Podium to the slide-in Intermission Button/Menu CMD system Again, another hand-built Responder function falls to the efficiency of the MenuCMD Press [A] chad --- src/g_game.c | 19 ---------- src/k_podium.c | 96 +++++++++++++++++--------------------------------- src/k_podium.h | 18 ---------- 3 files changed, 32 insertions(+), 101 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 3d218fdc9..91e87e38a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1361,25 +1361,6 @@ boolean G_Responder(event_t *ev) return true; } } - else if (gamestate == GS_CEREMONY) - { - if (K_CeremonyResponder(ev)) - { - if (grandprixinfo.gp == true - && grandprixinfo.cup != NULL - && grandprixinfo.cup->playcredits == true) - { - nextmap = NEXTMAP_CREDITS; - } - else - { - nextmap = NEXTMAP_TITLE; - } - - G_EndGame(); - return true; - } - } if (gamestate == GS_LEVEL && ev->type == ev_keydown && multiplayer && demo.playback && !demo.freecam) { diff --git a/src/k_podium.c b/src/k_podium.c index ef455475b..9235c8965 100644 --- a/src/k_podium.c +++ b/src/k_podium.c @@ -461,70 +461,36 @@ void K_CeremonyTicker(boolean run) podiumData.delay = 0; } } + else if (podiumData.delay == TICRATE) + { + if (!menuactive && M_MenuConfirmPressed(0)) + { + podiumData.delay++; + } + } + else + { + if (++podiumData.delay == 2*TICRATE) + { + if (grandprixinfo.gp == true + && grandprixinfo.cup != NULL + && grandprixinfo.cup->playcredits == true) + { + nextmap = NEXTMAP_CREDITS; + } + else + { + nextmap = NEXTMAP_TITLE; + } + + G_EndGame(); + return; + } + } } } } -/*-------------------------------------------------- - boolean K_CeremonyResponder(event_t *event) - - See header file for description. ---------------------------------------------------*/ -boolean K_CeremonyResponder(event_t *event) -{ - INT32 key = event->data1; - - if (podiumData.ranking == false || podiumData.state < PODIUM_STATES) - { - return false; - } - - // remap virtual keys (mouse & joystick buttons) - switch (key) - { - case KEY_MOUSE1: - key = KEY_ENTER; - break; - case KEY_MOUSE1 + 1: - key = KEY_BACKSPACE; - break; - case KEY_JOY1: - case KEY_JOY1 + 2: - key = KEY_ENTER; - break; - case KEY_JOY1 + 3: - key = 'n'; - break; - case KEY_JOY1 + 1: - key = KEY_BACKSPACE; - break; - case KEY_HAT1: - key = KEY_UPARROW; - break; - case KEY_HAT1 + 1: - key = KEY_DOWNARROW; - break; - case KEY_HAT1 + 2: - key = KEY_LEFTARROW; - break; - case KEY_HAT1 + 3: - key = KEY_RIGHTARROW; - break; - } - - if (event->type != ev_keydown) - { - return false; - } - - if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE) - { - return false; - } - - return true; -} - /*-------------------------------------------------- void K_CeremonyDrawer(void) @@ -625,11 +591,8 @@ void K_CeremonyDrawer(void) ); break; } - case 9: + default: { - V_DrawThinString(2, BASEVIDHEIGHT - 10, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_6WIDTHSPACE, - "Press some button type deal to continue" - ); break; } } @@ -643,4 +606,9 @@ void K_CeremonyDrawer(void) // Level fade-in V_DrawCustomFadeScreen(((levelfadecol == 0) ? "FADEMAP1" : "FADEMAP0"), 31-(timeinmap*2)); } + + if (podiumData.state == PODIUM_STATES) + { + Y_DrawIntermissionButton(TICRATE - podiumData.delay, podiumData.delay - TICRATE); + } } diff --git a/src/k_podium.h b/src/k_podium.h index eb73a7aae..df0dbf2e1 100644 --- a/src/k_podium.h +++ b/src/k_podium.h @@ -189,24 +189,6 @@ void K_ResetCeremony(void); void K_CeremonyTicker(boolean run); -/*-------------------------------------------------- - void K_CeremonyResponder(event_t *ev); - - Responder function to be ran during the podium - cutscene mode gamestate. Handles key presses - ending the podium scene. - - Input Arguments:- - ev - The player input event. - - Return:- - true to end the podium cutscene and return - to the title screen, otherwise false. ---------------------------------------------------*/ - -boolean K_CeremonyResponder(event_t *ev); - - /*-------------------------------------------------- void K_CeremonyDrawer(void); From ee7f54bc2a0eb3fe472c9e260571b23078cb7a69 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Sep 2023 20:46:20 +0100 Subject: [PATCH 8/8] Further cleanup for Chat to not be whitelisted gamestates only Reduces the complexity of D_Display by a lot! --- src/d_main.c | 46 +++++++++++----------------------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index eef208098..a3347dc90 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -440,38 +440,18 @@ static void D_Display(void) switch (gamestate) { case GS_TITLESCREEN: - if (!titlemapinaction || !curbghide) { + if (!titlemapinaction || !curbghide) + { F_TitleScreenDrawer(); - break; } - /* FALLTHRU */ - case GS_LEVEL: - if (!gametic) - break; - HU_Erase(); - AM_Drawer(); break; case GS_INTERMISSION: Y_IntermissionDrawer(); - HU_Erase(); - HU_Drawer(); break; case GS_VOTING: Y_VoteDrawer(); - HU_Erase(); - HU_Drawer(); - break; - - case GS_CEREMONY: - if (!gametic) - break; - HU_Erase(); - HU_Drawer(); - break; - - case GS_MENU: break; case GS_INTRO: @@ -485,24 +465,14 @@ static void D_Display(void) case GS_CUTSCENE: F_CutsceneDrawer(); - HU_Erase(); - HU_Drawer(); break; case GS_EVALUATION: F_GameEvaluationDrawer(); - HU_Erase(); - HU_Drawer(); - break; - - case GS_CONTINUING: - //F_ContinueDrawer(); break; case GS_CREDITS: F_CreditDrawer(); - HU_Erase(); - HU_Drawer(); break; case GS_WAITINGPLAYERS: @@ -511,14 +481,15 @@ static void D_Display(void) { // I don't think HOM from nothing drawing is independent... F_WaitingPlayersDrawer(); - HU_Erase(); - HU_Drawer(); } case GS_DEDICATEDSERVER: case GS_NULL: + default: break; } + HU_Erase(); + // STUPID race condition... { wipegamestate = gamestate; @@ -628,9 +599,9 @@ static void D_Display(void) { case GS_LEVEL: { + AM_Drawer(); ST_Drawer(); F_TextPromptDrawer(); - HU_Drawer(); break; } case GS_TITLESCREEN: @@ -655,6 +626,11 @@ static void D_Display(void) } } + if (Playing()) + { + HU_Drawer(); + } + // change gamma if needed // (GS_LEVEL handles this already due to level-specific palettes) if (forcerefresh && G_GamestateUsesLevel() == false)