Only allow Time Attack for 1P

Battle gametype submenu no longer exists.
This commit is contained in:
Sally Coolatta 2022-08-28 06:08:30 -04:00
parent 6697fec70e
commit 6e5c955501
4 changed files with 76 additions and 25 deletions

View file

@ -187,7 +187,7 @@ extern menu_t PLAY_CharSelectDef;
extern menuitem_t PLAY_MainMenu[];
extern menu_t PLAY_MainDef;
extern menuitem_t PLAY_Gamemodes[];
extern menuitem_t PLAY_GamemodesMenu[];
extern menu_t PLAY_GamemodesDef;
extern menuitem_t PLAY_RaceGamemodesMenu[];
@ -617,6 +617,9 @@ boolean M_CharacterSelectHandler(INT32 choice);
void M_CharacterSelectTick(void);
boolean M_CharacterSelectQuit(void);
void M_SetupGametypeMenu(INT32 choice);
void M_SetupRaceMenu(INT32 choice);
#define CUPMENU_COLUMNS 7
#define CUPMENU_ROWS 2
#define CUPMENU_CURSORID (cupgrid.x + (cupgrid.y * CUPMENU_COLUMNS) + (cupgrid.pageno * (CUPMENU_COLUMNS * CUPMENU_ROWS)))

View file

@ -73,8 +73,8 @@ menu_t PLAY_CharSelectDef = {
menuitem_t PLAY_MainMenu[] =
{
{IT_STRING | IT_SUBMENU, "Local Play", "Play only on this computer.",
NULL, {.submenu = &PLAY_GamemodesDef}, 0, 0},
{IT_STRING | IT_CALL, "Local Play", "Play only on this computer.",
NULL, {.routine = M_SetupGametypeMenu}, 0, 0},
{IT_STRING | IT_CALL, "Online", "Connect to other computers.",
NULL, {.routine = M_MPOptSelectInit}, /*M_MPRoomSelectInit,*/ 0, 0},
@ -86,11 +86,14 @@ menu_t PLAY_MainDef = KARTGAMEMODEMENU(PLAY_MainMenu, &PLAY_CharSelectDef);
menuitem_t PLAY_GamemodesMenu[] =
{
{IT_STRING | IT_SUBMENU, "Race", "A contest to see who's the fastest of them all!",
NULL, {.submenu = &PLAY_RaceGamemodesDef}, 0, 0},
{IT_STRING | IT_CALL, "Race", "A contest to see who's the fastest of them all!",
NULL, {.routine = M_SetupRaceMenu}, 0, 0},
{IT_STRING | IT_SUBMENU, "Battle", "Sharpen your item usage in these special Battle zones!",
NULL, {.submenu = &PLAY_BattleGamemodesDef}, 0, 0},
{IT_STRING | IT_CALL, "Battle", "It's last hedgehog standing in this free-for-all!",
"MENIMG00", {.routine = M_LevelSelectInit}, 0, GT_BATTLE},
{IT_STRING | IT_CALL, "Capsules", "Bust up all of the capsules in record time!",
NULL, {.routine = M_LevelSelectInit}, 1, GT_BATTLE},
{IT_STRING | IT_CALL, "Back", NULL, NULL, {.routine = M_GoBack}, 0, 0},
};
@ -313,21 +316,6 @@ menu_t PLAY_TAGhostsDef = {
NULL
};
// BATTLE
menuitem_t PLAY_BattleGamemodesMenu[] =
{
{IT_STRING | IT_CALL, "Survival", "It's last hedgehog standing in this free-for-all!",
"MENIMG00", {.routine = M_LevelSelectInit}, 0, GT_BATTLE},
{IT_STRING | IT_CALL, "Time Attack", "Bust up all of the capsules in record time!",
NULL, {.routine = M_LevelSelectInit}, 1, GT_BATTLE},
{IT_STRING | IT_CALL, "Back", NULL, NULL, {.routine = M_GoBack}, 0, 0},
};
menu_t PLAY_BattleGamemodesDef = KARTGAMEMODEMENU(PLAY_BattleGamemodesMenu, &PLAY_GamemodesDef);
// MULTIPLAYER OPTION SELECT
menuitem_t PLAY_MP_OptSelect[] =
{

View file

@ -655,8 +655,22 @@ void M_DrawGenericMenu(void)
//
void M_DrawKartGamemodeMenu(void)
{
UINT8 n = currentMenu->numitems-1;
INT32 i, x = GM_STARTX - ((GM_XOFFSET / 2) * (n-1)), y = GM_STARTY - ((GM_YOFFSET / 2) * (n-1));
UINT8 n = 0;
INT32 i, x, y;
for (i = 0; i < currentMenu->numitems; i++)
{
if (currentMenu->menuitems[i].status == IT_DISABLED)
{
continue;
}
n++;
}
n--;
x = GM_STARTX - ((GM_XOFFSET / 2) * (n-1));
y = GM_STARTY - ((GM_YOFFSET / 2) * (n-1));
M_DrawMenuTooltips();
@ -667,7 +681,12 @@ void M_DrawKartGamemodeMenu(void)
for (i = 0; i < currentMenu->numitems; i++)
{
if (i >= n)
if (currentMenu->menuitems[i].status == IT_DISABLED)
{
continue;
}
if (i >= currentMenu->numitems-1)
{
x = GM_STARTX + (GM_XOFFSET * 5 / 2);
y = GM_STARTY + (GM_YOFFSET * 5 / 2);

View file

@ -3156,6 +3156,47 @@ boolean M_CharacterSelectQuit(void)
return true;
}
void M_SetupGametypeMenu(INT32 choice)
{
(void)choice;
PLAY_GamemodesDef.prevMenu = currentMenu;
if (cv_splitplayers.value <= 1)
{
// Remove Battle, add Capsules
PLAY_GamemodesMenu[1].status = IT_DISABLED;
PLAY_GamemodesMenu[2].status = IT_STRING | IT_CALL;
}
else
{
// Add Battle, remove Capsules
PLAY_GamemodesMenu[1].status = IT_STRING | IT_CALL;
PLAY_GamemodesMenu[2].status = IT_DISABLED;
}
M_SetupNextMenu(&PLAY_GamemodesDef, false);
}
void M_SetupRaceMenu(INT32 choice)
{
(void)choice;
PLAY_RaceGamemodesDef.prevMenu = currentMenu;
// Time Attack is 1P only
if (cv_splitplayers.value <= 1)
{
PLAY_RaceGamemodesMenu[2].status = IT_STRING | IT_CALL;
}
else
{
PLAY_RaceGamemodesMenu[2].status = IT_DISABLED;
}
M_SetupNextMenu(&PLAY_RaceGamemodesDef, false);
}
// DIFFICULTY SELECT
void M_SetupDifficultySelect(INT32 choice)