Remove the version check on the settings file. miscellaneous-fixes
authorachurch
Sun, 13 Feb 2011 11:31:37 +0900
branchmiscellaneous-fixes
changeset 655 89e8c6a9ffb9
parent 652 8cc6d08d2392
child 656 7787c8b72b09
child 661 2653b576a562
Remove the version check on the settings file. This patch removes the version check on the usersettings.xml file, since it breaks controls for people on Windows with AQConfig.exe from v1.1.1. See: http://www.bit-blot.com/forum/index.php?topic=3797.0#msg31199
Aquaria/DSQ.cpp
Aquaria/UserSettings.cpp
Aquaria/UserSettings.h
--- a/Aquaria/DSQ.cpp	Sun Jan 30 02:00:18 2011 +0900
+++ b/Aquaria/DSQ.cpp	Sun Feb 13 11:31:37 2011 +0900
@@ -953,7 +953,6 @@
 	voiceOversEnabled = true;
 
 
-	user.fixShittyVista();
 	//core->messageBox("info", "loading user settings");
 	user.load(false);
 	
--- a/Aquaria/UserSettings.cpp	Sun Jan 30 02:00:18 2011 +0900
+++ b/Aquaria/UserSettings.cpp	Sun Feb 13 11:31:37 2011 +0900
@@ -34,33 +34,6 @@
 #endif
 
 
-void UserSettings::fixShittyVista()
-{
-	// load
-	load(false);
-
-	// check version #, is it equal to ours?
-	if (version.settingsVersion != VERSION_USERSETTINGS)
-	{
-#ifdef BBGE_BUILD_WINDOWS
-		//debugLog("User settings out of date, overwriting with defaults...");
-		MessageBox(0, "User settings out of date, overwriting with defaults...", "Aquaria", MB_OK);
-#endif
-		//errorLog("User settings out of date, updating...");
-
-		// if not, load the default settings for this version #
-		loadDefaults(false);
-
-		// then save over top of "usersettings.xml"
-		save();
-
-		/*
-		// then reload
-		load(false);
-		*/
-	}
-}
-
 void UserSettings::save()
 {
 	//initInputCodeMap();
@@ -305,7 +278,19 @@
 {
 	std::ostringstream os;
 	os << "default-" << VERSION_USERSETTINGS << ".xml";
-	load(doApply, os.str());
+	if (exists(os.str()))
+	{
+		load(doApply, os.str());
+		return;
+	}
+
+	if (exists("default_usersettings.xml"))
+	{
+		load(doApply, "default_usersettings.xml");
+		return;
+	}
+
+	errorLog("No default user settings file found! Controls may be broken.");
 }
 
 void UserSettings::load(bool doApply, const std::string &overrideFile)
--- a/Aquaria/UserSettings.h	Sun Jan 30 02:00:18 2011 +0900
+++ b/Aquaria/UserSettings.h	Sun Feb 13 11:31:37 2011 +0900
@@ -140,7 +140,6 @@
 		int settingsVersion;
 	} version;
 
-	void fixShittyVista();
 	void loadDefaults(bool doApply=true);
 	void load(bool doApply=true, const std::string &overrideFile="");
 	void save();