Per-game theme preference now remembered if value is "default"
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user