Per-game theme preference now remembered if value is "default"

This commit is contained in:
Chris Danford
2002-09-29 17:59:34 +00:00
parent 5a43236895
commit afa29318fc
2 changed files with 9 additions and 9 deletions
+8 -9
View File
@@ -169,15 +169,15 @@ void PrefsManager::ReadGamePrefsFromDisk()
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
IniFile ini;
ini.SetPath( "StepMania.ini" );
ini.SetPath( sGameName+"Prefs.ini" );
ini.ReadFile(); // it's OK if this fails
CString sAnnouncer = sGameName, sTheme = sGameName, sNoteSkin = sGameName;
// if these calls fail, the three strings will keep the initial values set above.
ini.GetValue( sGameName, "Announcer", sAnnouncer );
ini.GetValue( sGameName, "Theme", sTheme );
ini.GetValue( sGameName, "NoteSkin", sNoteSkin );
ini.GetValue( "Options", "Announcer", sAnnouncer );
ini.GetValue( "Options", "Theme", sTheme );
ini.GetValue( "Options", "NoteSkin", sNoteSkin );
// it's OK to call these functions with names that don't exist.
ANNOUNCER->SwitchAnnouncer( sAnnouncer );
@@ -192,12 +192,11 @@ void PrefsManager::SaveGamePrefsToDisk()
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
IniFile ini;
ini.SetPath( "StepMania.ini" );
ini.ReadFile(); // it's OK if this fails
ini.SetPath( sGameName+"Prefs.ini" );
ini.SetValue( sGameName, "Announcer", ANNOUNCER->GetCurAnnouncerName() );
ini.SetValue( sGameName, "Theme", THEME->GetCurThemeName() );
ini.SetValue( sGameName, "NoteSkin", GAMEMAN->GetCurNoteSkin() );
ini.SetValue( "Options", "Announcer", ANNOUNCER->GetCurAnnouncerName() );
ini.SetValue( "Options", "Theme", THEME->GetCurThemeName() );
ini.SetValue( "Options", "NoteSkin", GAMEMAN->GetCurNoteSkin() );
ini.WriteFile();
}