mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Dehardcode menu gametype selection, part 3
Multiplayer map select now uses the value of `menugametype` accessible just above it on the menu, instead of having to select from a hardcoded set of options
This commit is contained in:
parent
be49e99a9e
commit
b09045f657
3 changed files with 10 additions and 20 deletions
|
|
@ -436,9 +436,6 @@ typedef enum
|
||||||
mpause_title,
|
mpause_title,
|
||||||
} mpause_e;
|
} mpause_e;
|
||||||
|
|
||||||
extern menuitem_t PAUSE_GamemodesMenu[];
|
|
||||||
extern menu_t PAUSE_GamemodesDef;
|
|
||||||
|
|
||||||
extern menuitem_t PAUSE_PlaybackMenu[];
|
extern menuitem_t PAUSE_PlaybackMenu[];
|
||||||
extern menu_t PAUSE_PlaybackMenuDef;
|
extern menu_t PAUSE_PlaybackMenuDef;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1596,8 +1596,8 @@ menuitem_t PAUSE_Main[] =
|
||||||
{IT_STRING | IT_KEYHANDLER, "GAMETYPE", "M_ICOGAM",
|
{IT_STRING | IT_KEYHANDLER, "GAMETYPE", "M_ICOGAM",
|
||||||
NULL, {.routine = M_HandlePauseMenuGametype}, 0, 0},
|
NULL, {.routine = M_HandlePauseMenuGametype}, 0, 0},
|
||||||
|
|
||||||
{IT_STRING | IT_SUBMENU, "CHANGE MAP", "M_ICOMAP",
|
{IT_STRING | IT_CALL, "CHANGE MAP", "M_ICOMAP",
|
||||||
NULL, {.submenu = &PAUSE_GamemodesDef}, 0, 0},
|
NULL, {.routine = M_LevelSelectInit}, 0, -1},
|
||||||
|
|
||||||
{IT_STRING | IT_CALL, "RESTART MAP", "M_ICORE",
|
{IT_STRING | IT_CALL, "RESTART MAP", "M_ICORE",
|
||||||
NULL, {.routine = M_RestartMap}, 0, 0},
|
NULL, {.routine = M_RestartMap}, 0, 0},
|
||||||
|
|
@ -1650,20 +1650,6 @@ menu_t PAUSE_MainDef = {
|
||||||
M_PauseInputs
|
M_PauseInputs
|
||||||
};
|
};
|
||||||
|
|
||||||
// PAUSE : Map switching gametype selection (In case you want to pick from battle / race...)
|
|
||||||
menuitem_t PAUSE_GamemodesMenu[] =
|
|
||||||
{
|
|
||||||
{IT_STRING | IT_CALL, "Race", "Select which gamemode to choose a new map from.",
|
|
||||||
NULL, {.routine = M_LevelSelectInit}, 0, GT_RACE},
|
|
||||||
|
|
||||||
{IT_STRING | IT_CALL, "Battle", "Select which gamemode to choose a new map from.",
|
|
||||||
NULL, {.routine = M_LevelSelectInit}, 0, GT_BATTLE},
|
|
||||||
|
|
||||||
{IT_STRING | IT_CALL, "Back", NULL, NULL, {.routine = M_GoBack}, 0, 0},
|
|
||||||
};
|
|
||||||
|
|
||||||
menu_t PAUSE_GamemodesDef = KARTGAMEMODEMENU(PAUSE_GamemodesMenu, &PAUSE_MainDef);
|
|
||||||
|
|
||||||
// Replay popup menu
|
// Replay popup menu
|
||||||
menuitem_t PAUSE_PlaybackMenu[] =
|
menuitem_t PAUSE_PlaybackMenu[] =
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3676,6 +3676,8 @@ static void M_LevelListFromGametype(INT16 gt)
|
||||||
|
|
||||||
void M_LevelSelectInit(INT32 choice)
|
void M_LevelSelectInit(INT32 choice)
|
||||||
{
|
{
|
||||||
|
INT32 gt = currentMenu->menuitems[itemOn].mvar2;
|
||||||
|
|
||||||
(void)choice;
|
(void)choice;
|
||||||
|
|
||||||
// Make sure this is reset as we'll only be using this function for offline games!
|
// Make sure this is reset as we'll only be using this function for offline games!
|
||||||
|
|
@ -3702,7 +3704,12 @@ void M_LevelSelectInit(INT32 choice)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
M_LevelListFromGametype(currentMenu->menuitems[itemOn].mvar2);
|
if (gt == -1)
|
||||||
|
{
|
||||||
|
gt = menugametype;
|
||||||
|
}
|
||||||
|
|
||||||
|
M_LevelListFromGametype(gt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_LevelSelected(INT16 add)
|
static void M_LevelSelected(INT16 add)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue