mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
- fixed 1247
This commit is contained in:
parent
e936700438
commit
8f998b009b
@ -57,6 +57,7 @@ SettingsStorage::SettingsStorage():
|
||||
|
||||
void SettingsStorage::init()
|
||||
{
|
||||
CResourceHandler::get()->createResource("config/settings.json");
|
||||
JsonNode(ResourceID("config/settings.json")).swap(config);
|
||||
JsonNode schema(ResourceID("config/defaultSettings.json"));
|
||||
JsonUtils::validate(config, schema);
|
||||
@ -73,8 +74,6 @@ void SettingsStorage::invalidateNode(const std::vector<std::string> &changedPath
|
||||
savedConf.Struct().erase("session");
|
||||
JsonUtils::minimize(savedConf, schema);
|
||||
|
||||
CResourceHandler::get()->createResource("CONFIG/settings.json");
|
||||
|
||||
std::ofstream file(CResourceHandler::get()->getResourceName(ResourceID("config/settings.json")), std::ofstream::trunc);
|
||||
file << savedConf;
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ bool CFilesystemLoader::createEntry(std::string filename)
|
||||
return false;
|
||||
|
||||
fileList[res] = filename;
|
||||
std::ofstream newfile (baseDirectory + "/" + filename);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user