1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

make it also usable on android

This commit is contained in:
Laserlicht 2024-08-28 23:07:00 +02:00
parent 8ae4a4ab8a
commit aa6cbdf13b
5 changed files with 17 additions and 5 deletions

View File

@ -11,6 +11,7 @@
#include "AdventureOptionsTab.h"
#include "../../eventsSDL/InputHandler.h"
#include "../../../lib/filesystem/ResourcePath.h"
#include "../../gui/CGuiHandler.h"
#include "../../widgets/Buttons.h"
@ -36,6 +37,9 @@ AdventureOptionsTab::AdventureOptionsTab()
OBJECT_CONSTRUCTION;
setRedrawParent(true);
addConditional("touchscreen", GH.input().getCurrentInputMode() == InputMode::TOUCH);
addConditional("keyboardMouse", GH.input().getCurrentInputMode() == InputMode::KEYBOARD_AND_MOUSE);
addConditional("controller", GH.input().getCurrentInputMode() == InputMode::CONTROLLER);
#ifdef VCMI_MOBILE
addConditional("mobile", true);
addConditional("desktop", false);

View File

@ -97,7 +97,9 @@ GeneralOptionsTab::GeneralOptionsTab()
OBJECT_CONSTRUCTION;
setRedrawParent(true);
addConditional("touchscreen", GH.input().hasTouchInputDevice());
addConditional("touchscreen", GH.input().getCurrentInputMode() == InputMode::TOUCH);
addConditional("keyboardMouse", GH.input().getCurrentInputMode() == InputMode::KEYBOARD_AND_MOUSE);
addConditional("controller", GH.input().getCurrentInputMode() == InputMode::CONTROLLER);
#ifdef VCMI_MOBILE
addConditional("mobile", true);
addConditional("desktop", false);

View File

@ -196,3 +196,8 @@ void SettingsMainWindow::onScreenResize()
if (tab)
tab->updateResolutionSelector();
}
void SettingsMainWindow::inputModeChanged(InputMode mode)
{
tabContentArea->reset();
}

View File

@ -42,5 +42,6 @@ public:
void showAll(Canvas & to) override;
void onScreenResize() override;
void inputModeChanged(InputMode mode) override;
};

View File

@ -364,7 +364,7 @@
},
{
"text": "vcmi.adventureOptions.leftButtonDrag.hover",
"created" : "desktop"
"created" : "keyboardMouse"
},
{
"text": "vcmi.adventureOptions.smoothDragging.hover"
@ -379,7 +379,7 @@
[
{
"text": "vcmi.adventureOptions.rightButtonDrag.hover",
"created" : "desktop"
"created" : "keyboardMouse"
}
]
},
@ -423,7 +423,7 @@
"name": "leftButtonDragCheckbox",
"help": "vcmi.adventureOptions.leftButtonDrag",
"callback": "leftButtonDragChanged",
"created" : "desktop"
"created" : "keyboardMouse"
},
{
"name": "smoothDraggingCheckbox",
@ -442,7 +442,7 @@
"name": "rightButtonDragCheckbox",
"help": "vcmi.adventureOptions.rightButtonDrag",
"callback": "rightButtonDragChanged",
"created" : "desktop"
"created" : "keyboardMouse"
}
]
}