浏览代码

Removed no longer used touchscreen option

Ivan Savenko 2 年之前
父节点
当前提交
a08ff1e6ef

+ 2 - 18
client/windows/settings/BattleOptionsTab.cpp

@@ -8,14 +8,12 @@
  *
  */
 #include "StdInc.h"
-
 #include "BattleOptionsTab.h"
-#include "CConfigHandler.h"
 
 #include "../../battle/BattleInterface.h"
-#include "../../battle/BattleActionsController.h"
 #include "../../gui/CGuiHandler.h"
 #include "../../eventsSDL/InputHandler.h"
+#include "../../../lib/CConfigHandler.h"
 #include "../../../lib/filesystem/ResourceID.h"
 #include "../../../lib/CGeneralTextHandler.h"
 #include "../../widgets/Buttons.h"
@@ -26,7 +24,7 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner)
 	OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
 	type |= REDRAW_PARENT;
 
-	addConditional("touchscreen", GH.input().hasTouchInputDevice());
+	//addConditional("touchscreen", GH.input().hasTouchInputDevice());
 
 	const JsonNode config(ResourceID("config/widgets/settings/battleOptionsTab.json"));
 	addCallback("viewGridChanged", [this, owner](bool value)
@@ -61,10 +59,6 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner)
 	{
 		skipBattleIntroMusicChangedCallback(value);
 	});
-	addCallback("touchscreenModeChanged", [this, owner](bool value)
-	{
-		touchscreenModeChangedCallback(value, owner);
-	});
 	build(config);
 
 	std::shared_ptr<CToggleGroup> animationSpeedToggle = widget<CToggleGroup>("animationSpeedPicker");
@@ -84,10 +78,6 @@ BattleOptionsTab::BattleOptionsTab(BattleInterface * owner)
 
 	std::shared_ptr<CToggleButton> mouseShadowCheckbox = widget<CToggleButton>("mouseShadowCheckbox");
 	mouseShadowCheckbox->setSelected(settings["battle"]["mouseShadow"].Bool());
-	
-	std::shared_ptr<CToggleButton> touchscreenModeCheckbox = widget<CToggleButton>("touchscreenModeCheckbox");
-	if (touchscreenModeCheckbox)
-		touchscreenModeCheckbox->setSelected(settings["battle"]["touchscreenMode"].Bool());
 
 	std::shared_ptr<CToggleButton> skipBattleIntroMusicCheckbox = widget<CToggleButton>("skipBattleIntroMusicCheckbox");
 	skipBattleIntroMusicCheckbox->setSelected(settings["gameTweaks"]["skipBattleIntroMusic"].Bool());
@@ -168,12 +158,6 @@ void BattleOptionsTab::mouseShadowChangedCallback(bool value)
 	shadow->Bool() = value;
 }
 
-void BattleOptionsTab::touchscreenModeChangedCallback(bool value, BattleInterface * parentBattleInterface)
-{
-	Settings touchcreenMode = settings.write["battle"]["touchscreenMode"];
-	touchcreenMode->Bool() = value;
-}
-
 void BattleOptionsTab::animationSpeedChangedCallback(int value)
 {
 	Settings speed = settings.write["battle"]["speedFactor"];

+ 0 - 1
client/windows/settings/BattleOptionsTab.h

@@ -30,7 +30,6 @@ private:
 	void showQueueChangedCallback(bool value, BattleInterface * parentBattleInterface);
 	void queueSizeChangedCallback(int value, BattleInterface * parentBattleInterface);
 	void skipBattleIntroMusicChangedCallback(bool value);
-	void touchscreenModeChangedCallback(bool value, BattleInterface * parentBattleInterface);
 public:
 	BattleOptionsTab(BattleInterface * owner = nullptr);
 };

+ 1 - 5
config/schemas/settings.json

@@ -281,7 +281,7 @@
 			"type" : "object",
 			"additionalProperties" : false,
 			"default" : {},
-			"required" : [ "speedFactor", "mouseShadow", "cellBorders", "stackRange", "movementHighlightOnHover", "showQueue", "queueSize", "touchscreenMode" ],
+			"required" : [ "speedFactor", "mouseShadow", "cellBorders", "stackRange", "movementHighlightOnHover", "showQueue", "queueSize" ],
 			"properties" : {
 				"speedFactor" : {
 					"type" : "number",
@@ -295,10 +295,6 @@
 					"type" : "boolean",
 					"default" : false
 				},
-				"touchscreenMode" : {
-					"type" : "boolean",
-					"default" : true
-				},
 				"stackRange" : {
 					"type" : "boolean",
 					"default" : true

+ 1 - 11
config/widgets/settings/battleOptionsTab.json

@@ -112,10 +112,6 @@
 				},
 				{
 					"text": "vcmi.battleOptions.skipBattleIntroMusic.hover",
-				},
-				{
-					"created" : "touchscreen",
-					"text": "vcmi.battleOptions.touchscreenMode.hover",
 				}
 			]
 		},
@@ -149,13 +145,7 @@
 					"name": "skipBattleIntroMusicCheckbox",
 					"help": "vcmi.battleOptions.skipBattleIntroMusic",
 					"callback": "skipBattleIntroMusicChanged"
-				},
-				{
-					"name": "touchscreenModeCheckbox",
-					"help": "vcmi.battleOptions.touchscreenMode",
-					"created" : "touchscreen",
-					"callback": "touchscreenModeChanged"
-				},
+				}
 			]
 		},
 /////////////////////////////////////// Bottom section - Animation Speed and Turn Order