From 0be374345001b22d0c56f46a72e6bcdd3f62431f Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 6 Oct 2019 14:11:16 -0700 Subject: [PATCH 1/3] Key handler to allow selecting map by arrow keys in Record Attack Enter still goes to the platter. --- src/m_menu.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 1ab361b80..86395d039 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -247,6 +247,7 @@ menu_t MISC_ScrambleTeamDef, MISC_ChangeTeamDef; // Single Player static void M_StartTutorial(INT32 choice); static void M_LoadGame(INT32 choice); +static void M_HandleTimeAttackLevelSelect(INT32 choice); static void M_TimeAttackLevelSelect(INT32 choice); static void M_TimeAttack(INT32 choice); static void M_NightsAttackLevelSelect(INT32 choice); @@ -743,7 +744,7 @@ static menuitem_t SP_TimeAttackLevelSelectMenu[] = // Single Player Time Attack static menuitem_t SP_TimeAttackMenu[] = { - {IT_STRING|IT_CALL, NULL, "Level Select...", &M_TimeAttackLevelSelect, 52}, + {IT_STRING|IT_KEYHANDLER, NULL, "Level Select...", M_HandleTimeAttackLevelSelect, 52}, {IT_STRING|IT_CVAR, NULL, "Character", &cv_chooseskin, 62}, {IT_DISABLED, NULL, "Guest Option...", &SP_GuestReplayDef, 100}, @@ -8400,6 +8401,37 @@ void M_DrawTimeAttackMenu(void) } } +static void M_HandleTimeAttackLevelSelect(INT32 choice) +{ + switch (choice) + { + case KEY_DOWNARROW: + M_NextOpt(); + break; + + case KEY_UPARROW: + M_PrevOpt(); + break; + + case KEY_LEFTARROW: + CV_AddValue(&cv_nextmap, -1); + break; + case KEY_RIGHTARROW: + CV_AddValue(&cv_nextmap, 1); + break; + + case KEY_ENTER: + M_TimeAttackLevelSelect(0); + break; + + case KEY_ESCAPE: + noFurtherInput = true; + M_GoBack(0); + return; + } + S_StartSound(NULL, sfx_menu1); +} + static void M_TimeAttackLevelSelect(INT32 choice) { (void)choice; From 6fd645ef27b52bb60b60ab3f24f467c44dae45e3 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 6 Oct 2019 14:45:42 -0700 Subject: [PATCH 2/3] A-arrows on Record Attack level select Menu code sucks, did you know? --- src/m_menu.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 86395d039..77a4b1f46 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8331,7 +8331,18 @@ void M_DrawTimeAttackMenu(void) else PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); - V_DrawSmallScaledPatch(208, 32+lsheadingheight, 0, PictureOfLevel); + y = 32+lsheadingheight; + V_DrawSmallScaledPatch(208, y, 0, PictureOfLevel); + + if (itemOn == talevel) + { + /* Draw arrows !! */ + y = y + 25 - 4; + V_DrawCharacter(208 - 10 - (skullAnimCounter/5), y, + '\x1C' | V_YELLOWMAP, false); + V_DrawCharacter(208 + 80 + 2 + (skullAnimCounter/5), y, + '\x1D' | V_YELLOWMAP, false); + } V_DrawString(104 - 72, 32+lsheadingheight/2, 0, "* LEVEL RECORDS *"); From a2a5983256a80c697a5ab7bb0418f4908d84f280 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 12 Oct 2019 09:42:03 -0400 Subject: [PATCH 3/3] Prevent Time Attack level handler always beeping. --- src/m_menu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 77a4b1f46..2271c1bfd 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8419,7 +8419,6 @@ static void M_HandleTimeAttackLevelSelect(INT32 choice) case KEY_DOWNARROW: M_NextOpt(); break; - case KEY_UPARROW: M_PrevOpt(); break; @@ -8439,6 +8438,9 @@ static void M_HandleTimeAttackLevelSelect(INT32 choice) noFurtherInput = true; M_GoBack(0); return; + + default: + return; } S_StartSound(NULL, sfx_menu1); }