games will now try to use announcers, noteskin, and theme of the same name as the game initially.

This commit is contained in:
Chris Danford
2002-08-19 00:21:54 +00:00
parent 5c21d4b1ca
commit c82d2925ef
2 changed files with 15 additions and 11 deletions
+14 -10
View File
@@ -32,7 +32,11 @@ PrefsManager::PrefsManager()
m_iRefreshRate = 0;
m_bIgnoreJoyAxes = false;
m_bOnlyDedicatedMenuButtons = false;
#ifdef _DEBUG
m_bShowStats = true;
#else
m_bShowStats = false;
#endif
m_BackgroundMode = BGMODE_ANIMATIONS;
m_bShowDanger = true;
m_fBGBrightness = 0.8f;
@@ -130,16 +134,16 @@ void PrefsManager::ReadGamePrefsFromDisk()
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
IniFile ini;
ini.SetPath( sGameName + "Prefs.ini" );
if( !ini.ReadFile() )
return; // could not read config file, load nothing
ini.ReadFile(); // it's OK if this fails
CString sAnnouncer, sTheme, sNoteSkin;
ini.GetValue( "Options", "Announcer", sAnnouncer );
ini.GetValue( "Options", "Theme", sTheme );
ini.GetValue( "Options", "NoteSkin", sNoteSkin );
CString sAnnouncer = sGameName, sTheme = sGameName, sNoteSkin = sGameName;
// if these calls fail, the three strings will keep the initial values set above.
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 );
THEME->SwitchTheme( sTheme );
GAMEMAN->SwitchNoteSkin( sNoteSkin );
@@ -154,9 +158,9 @@ void PrefsManager::SaveGamePrefsToDisk()
IniFile ini;
ini.SetPath( sGameName + "Prefs.ini" );
ini.SetValue( "Options", "Announcer", ANNOUNCER->GetCurAnnouncerName() );
ini.SetValue( "Options", "Theme", THEME->GetCurThemeName() );
ini.SetValue( "Options", "NoteSkin", GAMEMAN->GetCurNoteSkin() );
ini.SetValue( "Options", "Announcer", ANNOUNCER->GetCurAnnouncerName() );
ini.SetValue( "Options", "Theme", THEME->GetCurThemeName() );
ini.SetValue( "Options", "NoteSkin", GAMEMAN->GetCurNoteSkin() );
ini.WriteFile();
}
+1 -1
View File
@@ -60,7 +60,7 @@ ScreenSelectStyle::ScreenSelectStyle()
for( int i=0; i<m_aPossibleStyles.GetSize(); i++ )
{
Style style = m_aPossibleStyles[i];
m_sprIcon[i].Load( THEME->GetPathTo("Graphics","select style icons") );
m_sprIcon[i].Load( THEME->GetPathTo("Graphics",ssprintf("select style icons game %d",GAMESTATE->m_CurGame) ) );
m_sprIcon[i].StopAnimating();
m_sprIcon[i].SetState( i );
m_sprIcon[i].SetXY( ICONS_START_X + i*ICONS_SPACING_X, ICONS_START_Y + i*ICONS_SPACING_Y );