add ScreenClearBookkeepingData, ScreenResetToDefaults

This commit is contained in:
Chris Danford
2004-05-16 22:58:05 +00:00
parent 633133f19f
commit 2fc1035d32
13 changed files with 198 additions and 23 deletions
+26 -6
View File
@@ -32,6 +32,13 @@ const CString DEFAULT_LIGHTS_DRIVER = "Null";
bool g_bAutoRestart = false;
PrefsManager::PrefsManager()
{
Init();
ReadGlobalPrefsFromDisk();
ReadStaticPrefsFromDisk();
}
void PrefsManager::Init()
{
#ifdef DEBUG
m_bWindowed = true;
@@ -286,8 +293,6 @@ PrefsManager::PrefsManager()
}
m_sMemoryCardProfileSubdir = PRODUCT_NAME;
ReadGlobalPrefsFromDisk();
}
PrefsManager::~PrefsManager()
@@ -296,13 +301,20 @@ PrefsManager::~PrefsManager()
void PrefsManager::ReadGlobalPrefsFromDisk()
{
IniFile ini;
ini.SetPath( STEPMANIA_INI_PATH );
ini.ReadFile();
ReadPrefsFromFile( STEPMANIA_INI_PATH );
}
void PrefsManager::ReadStaticPrefsFromDisk()
{
/* Load this on top of the regular INI; if it exists, any settings listed
* in it will override user settings. */
ini.SetPath( STATIC_INI_PATH );
ReadPrefsFromFile( STATIC_INI_PATH );
}
void PrefsManager::ReadPrefsFromFile( CString sIni )
{
IniFile ini;
ini.SetPath( sIni );
ini.ReadFile();
ini.GetValue( "Options", "Windowed", m_bWindowed );
@@ -763,3 +775,11 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
ini.WriteFile();
}
void PrefsManager::ResetToFactoryDefaults()
{
Init();
ReadStaticPrefsFromDisk();
SaveGlobalPrefsToDisk();
}