1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Removed no longer used touchscreen option

This commit is contained in:
Ivan Savenko
2023-05-31 16:14:58 +03:00
parent e6e91c64b6
commit a08ff1e6ef
4 changed files with 4 additions and 35 deletions

View File

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

View File

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

View File

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

View File

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