1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +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 "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");
@ -85,10 +79,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"];

View File

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

View File

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

View File

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