Merge branch 'pandoradev' into 'next'

Enable Pandora and Level Select with Devmode / Always allow Level Select if unlocked

See merge request STJr/SRB2!2066
This commit is contained in:
Logan Aerl Arias 2024-01-08 19:20:23 +00:00
commit 0781adc3ca
3 changed files with 20 additions and 6 deletions

View file

@ -475,6 +475,9 @@ UINT8 M_MapLocked(INT32 mapnum, gamedata_t *data)
// that's better than making dedicated server's lives hell.
return false;
}
if (cv_debug || devparm)
return false; // Unlock every level when in devmode.
if (!mapheaderinfo[mapnum-1] || mapheaderinfo[mapnum-1]->unlockrequired < 0)
{

View file

@ -3652,9 +3652,12 @@ void M_StartControlPanel(void)
}
else if (!(netgame || multiplayer)) // Single Player
{
// Devmode unlocks Pandora's Box in the pause menu
boolean pandora = ((M_SecretUnlocked(SECRET_PANDORA, serverGamedata) || cv_debug || devparm) && !marathonmode);
if (gamestate != GS_LEVEL || ultimatemode) // intermission, so gray out stuff.
{
SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA, serverGamedata)) ? (IT_GRAYEDOUT) : (IT_DISABLED);
SPauseMenu[spause_pandora].status = (pandora) ? (IT_GRAYEDOUT) : (IT_DISABLED);
SPauseMenu[spause_retry].status = IT_GRAYEDOUT;
}
else
@ -3663,7 +3666,7 @@ void M_StartControlPanel(void)
if (players[consoleplayer].playerstate != PST_LIVE)
++numlives;
SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA, serverGamedata) && !marathonmode) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
SPauseMenu[spause_pandora].status = (pandora) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
// The list of things that can disable retrying is (was?) a little too complex
// for me to want to use the short if statement syntax
@ -3674,7 +3677,11 @@ void M_StartControlPanel(void)
}
// We can always use level select though. :33
SPauseMenu[spause_levelselect].status = (maplistoption != 0) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
// Guarantee it if we have either it unlocked or devmode is enabled
if ((maplistoption != 0 || M_SecretUnlocked(SECRET_LEVELSELECT, serverGamedata) || cv_debug || devparm) && !marathonmode)
SPauseMenu[spause_levelselect].status = (IT_STRING | IT_CALL);
else
SPauseMenu[spause_levelselect].status = (IT_DISABLED);
// And emblem hints.
SPauseMenu[spause_hints].status = (M_SecretUnlocked(SECRET_EMBLEMHINTS, clientGamedata) && !marathonmode) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
@ -5142,7 +5149,8 @@ static boolean M_CanShowLevelOnPlatter(INT32 mapnum, INT32 gt)
return false;
case LLM_LEVELSELECT:
if (!(mapheaderinfo[mapnum]->levelselect & maplistoption))
if (!(mapheaderinfo[mapnum]->levelselect & maplistoption)
&& !(cv_debug || devparm)) //Allow ALL levels in devmode!
return false;
return true;
@ -7702,9 +7710,12 @@ static void M_PauseLevelSelect(INT32 choice)
SP_PauseLevelSelectDef.prevMenu = currentMenu;
levellistmode = LLM_LEVELSELECT;
// maplistoption is NOT specified, so that this
// maplistoption is only specified if not set already
// and we have the level select unlocked so that it
// transfers the level select list from the menu
// used to enter the game to the pause menu.
if (maplistoption == 0 && M_SecretUnlocked(SECRET_LEVELSELECT, serverGamedata))
maplistoption = 1;
if (!M_PrepareLevelPlatter(-1, true))
{

View file

@ -1825,7 +1825,7 @@ static void Command_Map_f(void)
return;
}
option_force = COM_CheckPartialParm("-f");
option_force = COM_CheckPartialParm("-f") || (cv_debug || devparm);
option_gametype = COM_CheckPartialParm("-g");
newresetplayers = ! COM_CheckParm("-noresetplayers");