1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

fetch Extra Resolutions mod path from the settings schema

This commit is contained in:
Andrey Filipenkov 2022-09-27 11:55:03 +03:00
parent 42ea458ccf
commit e8396401f9
2 changed files with 6 additions and 2 deletions

View File

@ -363,7 +363,7 @@
"type" : "object",
"default": {},
"additionalProperties" : false,
"required" : [ "repositoryURL", "enableInstalledMods", "autoCheckRepositories", "updateOnStartup", "updateConfigUrl" ],
"required" : [ "repositoryURL", "enableInstalledMods", "extraResolutionsModPath", "autoCheckRepositories", "updateOnStartup", "updateConfigUrl" ],
"properties" : {
"repositoryURL" : {
"type" : "array",
@ -378,6 +378,10 @@
"type" : "boolean",
"default" : true
},
"extraResolutionsModPath" : {
"type" : "string",
"default" : "/vcmi-extras/Mods/extraResolutions/Content/config/resolutions.json"
},
"autoCheckRepositories" : {
"type" : "boolean",
"default" : true

View File

@ -121,7 +121,7 @@ void CSettingsView::fillValidResolutionsForScreen(int screenIndex)
QVariantList resolutions;
if(isExtraResolutionsModEnabled)
{
const QLatin1String extrasResolutionsPath{"/vcmi-extras/Mods/extraResolutions/Content/config/resolutions.json"};
const auto extrasResolutionsPath = settings["launcher"]["extraResolutionsModPath"].String().c_str();
const auto extrasResolutionsJson = JsonUtils::JsonFromFile(CLauncherDirs::get().modsPath() + extrasResolutionsPath);
resolutions = extrasResolutionsJson.toMap().value(QLatin1String{"GUISettings"}).toList();
}