Sfoglia il codice sorgente

fetch Extra Resolutions mod path from the settings schema

Andrey Filipenkov 3 anni fa
parent
commit
e8396401f9

+ 5 - 1
config/schemas/settings.json

@@ -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

+ 1 - 1
launcher/settingsView/csettingsview_moc.cpp

@@ -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();
 	}