Load defaults.bin instead of settings-default.cfg. Do not decode yet.

pull/593/head
AnyOldName3 4 years ago
parent 92325976e9
commit 09f39b29f0

@ -424,11 +424,11 @@ bool Launcher::MainDialog::setupGraphicsSettings()
mEngineSettings.clear(); mEngineSettings.clear();
// Create the settings manager and load default settings file // Create the settings manager and load default settings file
const std::string localDefault = (mCfgMgr.getLocalPath() / "settings-default.cfg").string(); const std::string localDefault = (mCfgMgr.getLocalPath() / "defaults.bin").string();
const std::string globalDefault = (mCfgMgr.getGlobalPath() / "settings-default.cfg").string(); const std::string globalDefault = (mCfgMgr.getGlobalPath() / "defaults.bin").string();
std::string defaultPath; std::string defaultPath;
// Prefer the settings-default.cfg in the current directory. // Prefer the defaults.bin in the current directory.
if (boost::filesystem::exists(localDefault)) if (boost::filesystem::exists(localDefault))
defaultPath = localDefault; defaultPath = localDefault;
else if (boost::filesystem::exists(globalDefault)) else if (boost::filesystem::exists(globalDefault))

@ -478,8 +478,8 @@ void OMW::Engine::setSkipMenu (bool skipMenu, bool newGame)
std::string OMW::Engine::loadSettings (Settings::Manager & settings) std::string OMW::Engine::loadSettings (Settings::Manager & settings)
{ {
// Create the settings manager and load default settings file // Create the settings manager and load default settings file
const std::string localdefault = (mCfgMgr.getLocalPath() / "settings-default.cfg").string(); const std::string localdefault = (mCfgMgr.getLocalPath() / "defaults.bin").string();
const std::string globaldefault = (mCfgMgr.getGlobalPath() / "settings-default.cfg").string(); const std::string globaldefault = (mCfgMgr.getGlobalPath() / "defaults.bin").string();
// prefer local // prefer local
if (boost::filesystem::exists(localdefault)) if (boost::filesystem::exists(localdefault))

@ -7,7 +7,7 @@
#include <boost/filesystem/fstream.hpp> #include <boost/filesystem/fstream.hpp>
void Settings::SettingsFileParser::loadSettingsFile(const std::string& file, CategorySettingValueMap& settings) void Settings::SettingsFileParser::loadSettingsFile(const std::string& file, CategorySettingValueMap& settings, bool base64Encoded)
{ {
mFile = file; mFile = file;
boost::filesystem::ifstream stream; boost::filesystem::ifstream stream;

@ -10,7 +10,7 @@ namespace Settings
class SettingsFileParser class SettingsFileParser
{ {
public: public:
void loadSettingsFile(const std::string& file, CategorySettingValueMap& settings); void loadSettingsFile(const std::string& file, CategorySettingValueMap& settings, bool base64encoded = false);
void saveSettingsFile(const std::string& file, const CategorySettingValueMap& settings); void saveSettingsFile(const std::string& file, const CategorySettingValueMap& settings);

@ -22,7 +22,7 @@ void Manager::clear()
void Manager::loadDefault(const std::string &file) void Manager::loadDefault(const std::string &file)
{ {
SettingsFileParser parser; SettingsFileParser parser;
parser.loadSettingsFile(file, mDefaultSettings); parser.loadSettingsFile(file, mDefaultSettings, true);
} }
void Manager::loadUser(const std::string &file) void Manager::loadUser(const std::string &file)

Loading…
Cancel
Save