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