Key handler to allow selecting map by arrow keys in Record Attack

Enter still goes to the platter.
This commit is contained in:
James R 2019-10-06 14:11:16 -07:00
parent ff8c43664a
commit 0be3743450

View file

@ -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;