fix cases where prefs aren't persisted in case of power loss

This commit is contained in:
Chris Danford
2004-08-22 21:42:28 +00:00
parent e03e33f728
commit c51c661fdd
2 changed files with 9 additions and 1 deletions
+6
View File
@@ -587,6 +587,8 @@ retry:
SAFE_DELETE( pNewScreen );
goto retry;
}
bool bWasOnSystemMenu = GAMESTATE->m_bIsOnSystemMenu;
/* 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 */
@@ -603,6 +605,10 @@ retry:
GAMESTATE->m_bIsOnSystemMenu = true;
else
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");
SetFromNewScreen( pNewScreen, false );
+3 -1
View File
@@ -243,9 +243,11 @@ void ResetGame( bool ReturnToFirstScreen )
SCREENMAN->SetNewScreen( FIRST_RUN_INITIAL_SCREEN );
else
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();