Jelajahi Sumber

Added option to disable radial wheel in config (no UI)

Ivan Savenko 2 tahun lalu
induk
melakukan
6cd219738b
2 mengubah file dengan 17 tambahan dan 1 penghapusan
  1. 4 0
      client/widgets/CGarrisonInt.cpp
  2. 13 1
      config/schemas/settings.json

+ 4 - 0
client/widgets/CGarrisonInt.cpp

@@ -27,6 +27,7 @@
 #include "../../lib/ArtifactUtils.h"
 #include "../../lib/CGeneralTextHandler.h"
 #include "../../lib/CCreatureHandler.h"
+#include "../../lib/CConfigHandler.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/TextOperations.h"
 #include "../../lib/gameState/CGameState.h"
@@ -353,6 +354,9 @@ void CGarrisonSlot::gesture(bool on, const Point & initialPosition, const Point
 	if(!myStack)
 		return;
 
+	if (!settings["input"]["radialWheelGarrisonSwipe"].Bool())
+		return;
+
 	const auto * otherArmy = upg == EGarrisonType::UPPER ? owner->lowerArmy() : owner->upperArmy();
 
 	bool stackExists = myStack != nullptr;

+ 13 - 1
config/schemas/settings.json

@@ -3,7 +3,7 @@
 {
 	"type" : "object",
 	"$schema" : "http://json-schema.org/draft-04/schema",
-	"required" : [ "general", "video", "adventure", "battle", "server", "logging", "launcher", "gameTweaks" ],
+	"required" : [ "general", "video", "adventure", "battle", "input", "server", "logging", "launcher", "gameTweaks" ],
 	"definitions" : {
 		"logLevelEnum" : {
 			"type" : "string",
@@ -207,6 +207,18 @@
 				}
 			}
 		},
+		"input" : {
+			"type" : "object",
+			"additionalProperties" : false,
+			"default" : {},
+			"required" : [ "radialWheelGarrisonSwipe" ],
+			"properties" : {
+				"radialWheelGarrisonSwipe" : {
+					"type" : "boolean",
+					"default" : true
+				}
+			}
+		},
 		"adventure" : {
 			"type" : "object",
 			"additionalProperties" : false,