Commit 40df8d31 authored by Aloshi's avatar Aloshi

Added list of Settings keys to not save.

This way stuff like the --debug and --windowed flags no longer save to es_settings.xml.
parent c31c7c24
......@@ -3,9 +3,21 @@
#include "pugiXML/pugixml.hpp"
#include "platform.h"
#include <boost/filesystem.hpp>
#include <boost/assign.hpp>
Settings* Settings::sInstance = NULL;
// these values are NOT saved to es_settings.xml
// since they're set through command-line arguments, and not the in-program settings menu
std::vector<const char*> settings_dont_save = boost::assign::list_of
("Debug")
("DebugGrid")
("DebugText")
("ParseGamelistOnly")
("ShowExit")
("Windowed")
("IgnoreGamelist");
Settings::Settings()
{
setDefaults();
......@@ -33,7 +45,6 @@ void Settings::setDefaults()
mBoolMap["ShowHelpPrompts"] = true;
mBoolMap["ScrapeRatings"] = true;
mBoolMap["IgnoreGamelist"] = false;
mBoolMap["ParseGamelistOnly"] = false;
mBoolMap["QuickSystemSelect"] = true;
mBoolMap["Debug"] = false;
......@@ -44,8 +55,6 @@ void Settings::setDefaults()
mIntMap["ScraperResizeWidth"] = 400;
mIntMap["ScraperResizeHeight"] = 0;
mIntMap["GameListSortIndex"] = 0;
mStringMap["TransitionStyle"] = "fade";
mStringMap["ThemeSet"] = "";
mStringMap["ScreenSaverBehavior"] = "dim";
......@@ -57,6 +66,10 @@ void saveMap(pugi::xml_document& doc, std::map<K, V>& map, const char* type)
{
for(auto iter = map.begin(); iter != map.end(); iter++)
{
// key is on the "don't save" list, so don't save it
if(std::find(settings_dont_save.begin(), settings_dont_save.end(), iter->first) != settings_dont_save.end())
continue;
pugi::xml_node node = doc.append_child(type);
node.append_attribute("name").set_value(iter->first.c_str());
node.append_attribute("value").set_value(iter->second);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment