Only ask for profile on startup once per session

Fixes Time Attack ending resetting you to the Guest profile, and makes going back to the title screen slightly less frustrating
This commit is contained in:
Sally Coolatta 2022-08-28 07:47:26 -04:00
parent 74449ba55e
commit 88fa175a49

View file

@ -931,35 +931,44 @@ void M_StartControlPanel(void)
menuactive = true; menuactive = true;
if (demo.playback) if (!Playing())
{ {
currentMenu = &PAUSE_PlaybackMenuDef; if (cv_currprofile.value == -1) // Only ask once per session.
} {
else if (!Playing()) // we need to do this before setting ApplyProfile otherwise funky things are going to happen.
{ currentMenu = &MAIN_ProfilesDef;
// we need to do this before setting ApplyProfile otherwise funky things are going to happen. optionsmenu.profilen = cv_ttlprofilen.value;
currentMenu = &MAIN_ProfilesDef;
optionsmenu.profilen = cv_ttlprofilen.value;
// options don't need initializing here. // options don't need initializing here.
PR_ApplyProfile(0, 0); // apply guest profile to player 0 by default. PR_ApplyProfile(0, 0); // apply guest profile to player 0 by default.
// this is to garantee that the controls aren't fucked up. // this is to garantee that the controls aren't fucked up.
// make sure we don't overstep that. // make sure we don't overstep that.
if (optionsmenu.profilen > PR_GetNumProfiles()) if (optionsmenu.profilen > PR_GetNumProfiles())
optionsmenu.profilen = PR_GetNumProfiles(); optionsmenu.profilen = PR_GetNumProfiles();
else if (optionsmenu.profilen < 0) else if (optionsmenu.profilen < 0)
optionsmenu.profilen = 0; optionsmenu.profilen = 0;
itemOn = 0; itemOn = 0;
CV_StealthSetValue(&cv_currprofile, -1); // Make sure to reset that as it is set by PR_ApplyProfile which we kind of hack together to force it. CV_StealthSetValue(&cv_currprofile, -1); // Make sure to reset that as it is set by PR_ApplyProfile which we kind of hack together to force it.
CV_StealthSetValue(&cv_splitdevice, 0); // Disable this option by default. CV_StealthSetValue(&cv_splitdevice, 0); // Disable this option by default.
}
else
{
currentMenu = &MainDef;
}
} }
else else
{ {
// For now let's just always open the same pause menu. if (demo.playback)
M_OpenPauseMenu(); {
currentMenu = &PAUSE_PlaybackMenuDef;
}
else
{
M_OpenPauseMenu();
}
} }
CON_ToggleOff(); // move away console CON_ToggleOff(); // move away console