when bSwitchToLastPlayedGame, do so before loading announcer/theme
This commit is contained in:
+14
-16
@@ -710,14 +710,23 @@ void ReadGamePrefsFromDisk( bool bSwitchToLastPlayedGame )
|
|||||||
ASSERT( THEME );
|
ASSERT( THEME );
|
||||||
ASSERT( GAMESTATE );
|
ASSERT( GAMESTATE );
|
||||||
|
|
||||||
if( GAMESTATE->m_pCurGame == NULL )
|
|
||||||
GAMESTATE->m_pCurGame = GAMEMAN->GetDefaultGame();
|
|
||||||
CString sGameName = GAMESTATE->GetCurrentGame()->m_szName;
|
|
||||||
|
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.ReadFile( GAMEPREFS_INI_PATH ); // it's OK if this fails
|
ini.ReadFile( GAMEPREFS_INI_PATH ); // it's OK if this fails
|
||||||
ini.ReadFile( STATIC_INI_PATH ); // it's OK if this fails, too
|
ini.ReadFile( STATIC_INI_PATH ); // it's OK if this fails, too
|
||||||
|
|
||||||
|
if( bSwitchToLastPlayedGame )
|
||||||
|
{
|
||||||
|
ASSERT( GAMEMAN != NULL );
|
||||||
|
CString sGame;
|
||||||
|
GAMESTATE->m_pCurGame = NULL;
|
||||||
|
if( ini.GetValue("Options", "Game", sGame) )
|
||||||
|
GAMESTATE->m_pCurGame = GAMEMAN->StringToGameType( sGame );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( GAMESTATE->m_pCurGame == NULL )
|
||||||
|
GAMESTATE->m_pCurGame = GAMEMAN->GetDefaultGame();
|
||||||
|
CString sGameName = GAMESTATE->GetCurrentGame()->m_szName;
|
||||||
|
|
||||||
CString sAnnouncer = sGameName, sTheme = sGameName, sNoteSkin = sGameName;
|
CString sAnnouncer = sGameName, sTheme = sGameName, sNoteSkin = sGameName;
|
||||||
|
|
||||||
// if these calls fail, the three strings will keep the initial values set above.
|
// if these calls fail, the three strings will keep the initial values set above.
|
||||||
@@ -730,17 +739,6 @@ void ReadGamePrefsFromDisk( bool bSwitchToLastPlayedGame )
|
|||||||
THEME->SwitchThemeAndLanguage( sTheme, PREFSMAN->m_sLanguage );
|
THEME->SwitchThemeAndLanguage( sTheme, PREFSMAN->m_sLanguage );
|
||||||
|
|
||||||
// NOTESKIN->SwitchNoteSkin( sNoteSkin );
|
// NOTESKIN->SwitchNoteSkin( sNoteSkin );
|
||||||
|
|
||||||
if( bSwitchToLastPlayedGame )
|
|
||||||
{
|
|
||||||
CString sGame;
|
|
||||||
if( ini.GetValue("Options", "Game", sGame) )
|
|
||||||
{
|
|
||||||
GAMESTATE->m_pCurGame = GAMEMAN->StringToGameType( sGame );
|
|
||||||
if( GAMESTATE->m_pCurGame == NULL )
|
|
||||||
GAMESTATE->m_pCurGame = GAMEMAN->GetDefaultGame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1018,11 +1016,11 @@ int main(int argc, char* argv[])
|
|||||||
GAMEMAN = new GameManager;
|
GAMEMAN = new GameManager;
|
||||||
THEME = new ThemeManager;
|
THEME = new ThemeManager;
|
||||||
ANNOUNCER = new AnnouncerManager;
|
ANNOUNCER = new AnnouncerManager;
|
||||||
|
NOTESKIN = new NoteSkinManager;
|
||||||
|
|
||||||
/* Set up the theme and announcer. */
|
/* Set up the theme and announcer. */
|
||||||
ReadGamePrefsFromDisk();
|
ReadGamePrefsFromDisk();
|
||||||
|
|
||||||
NOTESKIN = new NoteSkinManager;
|
|
||||||
if( PREFSMAN->m_iSoundWriteAhead )
|
if( PREFSMAN->m_iSoundWriteAhead )
|
||||||
LOG->Info( "Sound writeahead has been overridden to %i", PREFSMAN->m_iSoundWriteAhead );
|
LOG->Info( "Sound writeahead has been overridden to %i", PREFSMAN->m_iSoundWriteAhead );
|
||||||
SOUNDMAN = new RageSoundManager;
|
SOUNDMAN = new RageSoundManager;
|
||||||
|
|||||||
Reference in New Issue
Block a user