Clean up interactions between Goner Setup and restoreMenu behaviour

This commit is contained in:
toaster 2023-12-18 16:29:57 +00:00
parent 83025f10e9
commit b308a81e9d
3 changed files with 12 additions and 4 deletions

View file

@ -648,6 +648,7 @@ boolean M_MenuExtraPressed(UINT8 pid);
boolean M_MenuExtraHeld(UINT8 pid); boolean M_MenuExtraHeld(UINT8 pid);
void M_StartControlPanel(void); void M_StartControlPanel(void);
void M_ValidateRestoreMenu(void);
menu_t *M_SpecificMenuRestore(menu_t *torestore); menu_t *M_SpecificMenuRestore(menu_t *torestore);
void M_ClearMenus(boolean callexitmenufunc); void M_ClearMenus(boolean callexitmenufunc);
void M_SelectableClearMenus(INT32 choice); void M_SelectableClearMenus(INT32 choice);

View file

@ -434,6 +434,12 @@ void M_PlayMenuJam(void)
#undef IsCurrentlyPlaying #undef IsCurrentlyPlaying
void M_ValidateRestoreMenu(void)
{
if (restoreMenu == NULL || restoreMenu == &MAIN_GonerDef)
restoreMenu = &MainDef;
}
// //
// M_SpecificMenuRestore // M_SpecificMenuRestore
// //
@ -587,7 +593,10 @@ void M_StartControlPanel(void)
{ {
// Are you ready for the First Boot Experience? // Are you ready for the First Boot Experience?
M_ResetOptions(); M_ResetOptions();
currentMenu = &MAIN_GonerDef; currentMenu = &MAIN_GonerDef;
restoreMenu = NULL;
M_PlayMenuJam(); M_PlayMenuJam();
} }
else if (cv_currprofile.value == -1) // Only ask once per session. else if (cv_currprofile.value == -1) // Only ask once per session.
@ -618,8 +627,7 @@ void M_StartControlPanel(void)
} }
else else
{ {
if (restoreMenu == NULL || restoreMenu == &MAIN_GonerDef) M_ValidateRestoreMenu();
restoreMenu = &MainDef;
currentMenu = M_SpecificMenuRestore(M_InterruptMenuWithChallenges(restoreMenu)); currentMenu = M_SpecificMenuRestore(M_InterruptMenuWithChallenges(restoreMenu));
restoreMenu = NULL; restoreMenu = NULL;

View file

@ -47,8 +47,7 @@ void M_FirstPickProfile(INT32 c)
PR_ApplyProfile(optionsmenu.profilen, 0); PR_ApplyProfile(optionsmenu.profilen, 0);
if (restoreMenu == NULL) M_ValidateRestoreMenu();
restoreMenu = &MainDef;
M_SetupNextMenu(M_SpecificMenuRestore(M_InterruptMenuWithChallenges(restoreMenu)), false); M_SetupNextMenu(M_SpecificMenuRestore(M_InterruptMenuWithChallenges(restoreMenu)), false);
restoreMenu = NULL; restoreMenu = NULL;