소스 검색

fetch Extra Resolutions mod path from the settings schema

Andrey Filipenkov 3 년 전
부모
커밋
e8396401f9
2개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 1
      config/schemas/settings.json
  2. 1 1
      launcher/settingsView/csettingsview_moc.cpp

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