Do SOME attempt to add quality of life changes to the admin Change Map flow, rather than just bypassing it entirely.

- Pre-select the current gametype when showing what gamemodes are available.
- Pre-select the current map's cup when opening up the cup view.
This commit is contained in:
toaster 2022-11-17 17:28:18 +00:00
parent 962393f7b9
commit 372854f8d3

View file

@ -3430,7 +3430,7 @@ static void M_LevelListFromGametype(INT16 gt)
if (levellist.newgametype == GT_RACE)
{
cupheader_t *cup = kartcupheaders;
UINT8 highestid = 0;
UINT8 highestid = 0, count = 0;
// Make sure there's valid cups before going to this menu.
if (cup == NULL)
@ -3439,7 +3439,16 @@ static void M_LevelListFromGametype(INT16 gt)
while (cup)
{
if (cup->unlockrequired == -1 || unlockables[cup->unlockrequired].unlocked)
{
highestid = cup->id;
if (Playing() && mapheaderinfo[gamemap-1] && mapheaderinfo[gamemap-1]->cup == cup)
{
cupgrid.x = count % CUPMENU_COLUMNS;
cupgrid.y = (count / CUPMENU_COLUMNS) % CUPMENU_ROWS;
cupgrid.pageno = count / (CUPMENU_COLUMNS * CUPMENU_ROWS);
}
count++;
}
cup = cup->next;
}
@ -5909,6 +5918,13 @@ void M_OpenPauseMenu(void)
if (server || IsPlayerAdmin(consoleplayer))
{
PAUSE_Main[mpause_switchmap].status = IT_STRING | IT_SUBMENU;
for (i = 0; i < PAUSE_GamemodesDef.numitems; i++)
{
if (PAUSE_GamemodesMenu[i].mvar2 != gametype)
continue;
PAUSE_GamemodesDef.lastOn = i;
break;
}
PAUSE_Main[mpause_restartmap].status = IT_STRING | IT_CALL;
PAUSE_Main[mpause_addons].status = IT_STRING | IT_CALL;
}