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;
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.SetPath( "StepMania.ini" );
|
ini.SetPath( sGameName+"Prefs.ini" );
|
||||||
ini.ReadFile(); // it's OK if this fails
|
ini.ReadFile(); // it's OK if this fails
|
||||||
|
|
||||||
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.
|
||||||
ini.GetValue( sGameName, "Announcer", sAnnouncer );
|
ini.GetValue( "Options", "Announcer", sAnnouncer );
|
||||||
ini.GetValue( sGameName, "Theme", sTheme );
|
ini.GetValue( "Options", "Theme", sTheme );
|
||||||
ini.GetValue( sGameName, "NoteSkin", sNoteSkin );
|
ini.GetValue( "Options", "NoteSkin", sNoteSkin );
|
||||||
|
|
||||||
// it's OK to call these functions with names that don't exist.
|
// it's OK to call these functions with names that don't exist.
|
||||||
ANNOUNCER->SwitchAnnouncer( sAnnouncer );
|
ANNOUNCER->SwitchAnnouncer( sAnnouncer );
|
||||||
@@ -192,12 +192,11 @@ void PrefsManager::SaveGamePrefsToDisk()
|
|||||||
|
|
||||||
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.SetPath( "StepMania.ini" );
|
ini.SetPath( sGameName+"Prefs.ini" );
|
||||||
ini.ReadFile(); // it's OK if this fails
|
|
||||||
|
|
||||||
ini.SetValue( sGameName, "Announcer", ANNOUNCER->GetCurAnnouncerName() );
|
ini.SetValue( "Options", "Announcer", ANNOUNCER->GetCurAnnouncerName() );
|
||||||
ini.SetValue( sGameName, "Theme", THEME->GetCurThemeName() );
|
ini.SetValue( "Options", "Theme", THEME->GetCurThemeName() );
|
||||||
ini.SetValue( sGameName, "NoteSkin", GAMEMAN->GetCurNoteSkin() );
|
ini.SetValue( "Options", "NoteSkin", GAMEMAN->GetCurNoteSkin() );
|
||||||
|
|
||||||
ini.WriteFile();
|
ini.WriteFile();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ ScreenTitleMenu::ScreenTitleMenu()
|
|||||||
else
|
else
|
||||||
THEME->SwitchTheme( "default" );
|
THEME->SwitchTheme( "default" );
|
||||||
}
|
}
|
||||||
|
PREFSMAN->SaveGamePrefsToDisk();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user