fix cases where prefs aren't persisted in case of power loss
This commit is contained in:
@@ -588,6 +588,8 @@ retry:
|
|||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool bWasOnSystemMenu = GAMESTATE->m_bIsOnSystemMenu;
|
||||||
|
|
||||||
/* If this is a system menu, don't let the operator key touch it!
|
/* If this is a system menu, don't let the operator key touch it!
|
||||||
However, if you add an options screen, please include it here -- Miryokuteki */
|
However, if you add an options screen, please include it here -- Miryokuteki */
|
||||||
if( sClassName == "ScreenOptionsMenu" ||
|
if( sClassName == "ScreenOptionsMenu" ||
|
||||||
@@ -604,6 +606,10 @@ retry:
|
|||||||
else
|
else
|
||||||
GAMESTATE->m_bIsOnSystemMenu = false;
|
GAMESTATE->m_bIsOnSystemMenu = false;
|
||||||
|
|
||||||
|
// If we're exiting a system menu, persist settings in case we don't exit normally
|
||||||
|
if( bWasOnSystemMenu && !GAMESTATE->m_bIsOnSystemMenu )
|
||||||
|
PREFSMAN->SaveGlobalPrefsToDisk();
|
||||||
|
|
||||||
LOG->Trace("... SetFromNewScreen");
|
LOG->Trace("... SetFromNewScreen");
|
||||||
SetFromNewScreen( pNewScreen, false );
|
SetFromNewScreen( pNewScreen, false );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,9 +243,11 @@ void ResetGame( bool ReturnToFirstScreen )
|
|||||||
SCREENMAN->SetNewScreen( FIRST_RUN_INITIAL_SCREEN );
|
SCREENMAN->SetNewScreen( FIRST_RUN_INITIAL_SCREEN );
|
||||||
else
|
else
|
||||||
SCREENMAN->SetNewScreen( INITIAL_SCREEN );
|
SCREENMAN->SetNewScreen( INITIAL_SCREEN );
|
||||||
|
|
||||||
|
PREFSMAN->m_bFirstRun = false;
|
||||||
|
PREFSMAN->SaveGlobalPrefsToDisk(); // persist FirstRun setting in case we don't exit normally
|
||||||
}
|
}
|
||||||
|
|
||||||
PREFSMAN->m_bFirstRun = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GameLoop();
|
static void GameLoop();
|
||||||
|
|||||||
Reference in New Issue
Block a user