diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-11-14 16:55:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-11-14 18:37:50 +0300 |
commit | 13642a6cddd8657ec84a2bfa94c6ac7d34545dba (patch) | |
tree | cefec154fe5b6ec59990c4ef5cfe67eba4a484e6 /src/gui | |
parent | eaaafe3312a361e332d495ee68451e424d90a19d (diff) | |
download | manaplus-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.gz manaplus-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.bz2 manaplus-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.xz manaplus-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.zip |
Add support for on screen joystick for moving.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui.cpp | 3 | ||||
-rw-r--r-- | src/gui/setup_input.cpp | 7 | ||||
-rw-r--r-- | src/gui/setup_input.h | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index f0171ede4..8d26acea8 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -661,7 +661,10 @@ void Gui::handleMouseInput() const gcn::MouseInput mouseInput = mInput->dequeueMouseInput(); if (touchManager.processEvent(mouseInput)) + { + mMouseInactivityTimer = 0; continue; + } // Save the current mouse state. It will be needed if modal focus // changes or modal mouse input focus changes. diff --git a/src/gui/setup_input.cpp b/src/gui/setup_input.cpp index 77c4fdb2a..ff3c1f49b 100644 --- a/src/gui/setup_input.cpp +++ b/src/gui/setup_input.cpp @@ -31,6 +31,7 @@ #include "gui/setupactiondata.h" #include "gui/widgets/button.h" +#include "gui/widgets/checkbox.h" #include "gui/widgets/layouthelper.h" #include "gui/widgets/listbox.h" #include "gui/widgets/scrollarea.h" @@ -98,6 +99,9 @@ Setup_Input::Setup_Input(const Widget2 *const widget) : mDefaultButton(new Button(this, _("Default"), "default", this)), mResetKeysButton(new Button(this, _("Reset all keys"), "resetkeys", this)), mTabs(new TabStrip(this, config.getIntValue("fontSize") + 10)), + mShowJoystick(config.getBoolValue("showScreenJoystick")), + mJoystickCheckBox(new CheckBox(this, + _("Show onscreen joystick"), mShowJoystick)), mKeySetting(false), mActionDataSize(new int [9]) { @@ -155,6 +159,7 @@ Setup_Input::Setup_Input(const Widget2 *const widget) : place(2, 6, mAssignKeyButton); place(3, 6, mUnassignKeyButton); place(4, 6, mDefaultButton); + place(0, 7, mJoystickCheckBox); int width = 600; if (config.getIntValue("screenwidth") >= 730) @@ -195,6 +200,8 @@ void Setup_Input::apply() "Resolve them, or gameplay may result in strange behaviour."), gettext(str1.c_str()), gettext(str2.c_str())), DIALOG_ERROR); } + mShowJoystick = mJoystickCheckBox->isSelected(); + config.setValue("showScreenJoystick", mShowJoystick); keyboard.setEnabled(true); inputManager.store(); } diff --git a/src/gui/setup_input.h b/src/gui/setup_input.h index 186c094be..6accafe27 100644 --- a/src/gui/setup_input.h +++ b/src/gui/setup_input.h @@ -31,6 +31,7 @@ #include <string> class Button; +class CheckBox; class ListBox; class KeyListModel; class TabStrip; @@ -97,6 +98,8 @@ class Setup_Input final : public SetupTab Button *mDefaultButton; Button *mResetKeysButton; TabStrip *mTabs; + bool mShowJoystick; + CheckBox *mJoystickCheckBox; bool mKeySetting; /**< flag to check if key being set. */ |