diff options
author | lubomyr | 2017-01-30 22:35:40 +0200 |
---|---|---|
committer | lubomyr | 2017-01-30 22:35:40 +0200 |
commit | 15acee29f19c845dc534d2c8af48a449ea1cd380 (patch) | |
tree | 5dd92b665f9131a0903bbaf15c913dc63d5ddf90 /gui | |
parent | ca55163ea1daa6e322ef1ddf4615ad73b4634e0d (diff) | |
download | scummvm-rg350-15acee29f19c845dc534d2c8af48a449ea1cd380.tar.gz scummvm-rg350-15acee29f19c845dc534d2c8af48a449ea1cd380.tar.bz2 scummvm-rg350-15acee29f19c845dc534d2c8af48a449ea1cd380.zip |
ANDROIDSDL: implemented checkbox for change mouse mode in Options menu
Diffstat (limited to 'gui')
-rw-r--r-- | gui/options.cpp | 41 | ||||
-rw-r--r-- | gui/options.h | 16 | ||||
-rw-r--r-- | gui/themes/scummclassic.zip | bin | 126739 -> 127241 bytes | |||
-rw-r--r-- | gui/themes/scummclassic/classic_layout.stx | 8 | ||||
-rw-r--r-- | gui/themes/scummclassic/classic_layout_lowres.stx | 8 | ||||
-rw-r--r-- | gui/themes/scummmodern.zip | bin | 1646279 -> 1646781 bytes | |||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout.stx | 8 | ||||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout_lowres.stx | 8 |
8 files changed, 89 insertions, 0 deletions
diff --git a/gui/options.cpp b/gui/options.cpp index 371a949c35..ffce01fc1e 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -136,6 +136,10 @@ OptionsDialog::~OptionsDialog() { } void OptionsDialog::init() { +#ifdef ANDROIDSDL + _enableAndroidSdlSettings = false; + _touchpadCheckbox = 0; +#endif _enableGraphicSettings = false; _gfxPopUp = 0; _gfxPopUpDesc = 0; @@ -202,6 +206,14 @@ void OptionsDialog::build() { _guioptionsString = ConfMan.get("guioptions", _domain); _guioptions = parseGameGUIOptions(_guioptionsString); } + +#ifdef ANDROIDSDL + // AndroidSDL options + if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) { + bool touchpadState = ConfMan.getBool("touchpad_mouse_mode", _domain); + _touchpadCheckbox->setState(touchpadState); + } +#endif // Graphic options if (_fullscreenCheckbox) { @@ -380,6 +392,14 @@ void OptionsDialog::open() { } void OptionsDialog::apply() { +#ifdef ANDROIDSDL + if (_enableAndroidSdlSettings) { + if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) { + ConfMan.setBool("touchpad_mouse_mode", _touchpadCheckbox->getState(), _domain); + g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState()); + } + } +#endif // Graphic options bool graphicsModeChanged = false; if (_fullscreenCheckbox) { @@ -672,6 +692,10 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data Dialog::handleCommand(sender, cmd, data); } } + +void OptionsDialog::setAndroidSdlSettingsState(bool enabled) { + _enableAndroidSdlSettings = enabled; +} void OptionsDialog::setGraphicSettingsState(bool enabled) { _enableGraphicSettings = enabled; @@ -798,6 +822,15 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) { _subSpeedSlider->setEnabled(ena); _subSpeedLabel->setEnabled(ena); } + +#ifdef ANDROIDSDL + void OptionsDialog::addAndroidSdlControls(GuiObject *boss, const Common::String &prefix) { + // Touchpad Mouse mode + _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode")); + + _enableAndroidSdlSettings = true; + } +#endif void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &prefix) { const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes(); @@ -1226,6 +1259,14 @@ void GlobalOptionsDialog::build() { // The tab widget TabWidget *tab = new TabWidget(this, "GlobalOptions.TabWidget"); +#ifdef ANDROIDSDL + // + // The control tab only for Android SDL platform + // + tab->addTab(_("Control")); + addAndroidSdlControls(tab, "GlobalOptions_AndroidSdl."); +#endif + // // 1) The graphics tab // diff --git a/gui/options.h b/gui/options.h index a6eebe5748..e6bb195b41 100644 --- a/gui/options.h +++ b/gui/options.h @@ -86,6 +86,9 @@ protected: virtual void clean(); void rebuild(); +#ifdef ANDROIDSDL + void addAndroidSdlControls(GuiObject *boss, const Common::String &prefix); +#endif void addGraphicControls(GuiObject *boss, const Common::String &prefix); void addAudioControls(GuiObject *boss, const Common::String &prefix); void addMIDIControls(GuiObject *boss, const Common::String &prefix); @@ -96,6 +99,9 @@ protected: void addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal = 255); void addEngineControls(GuiObject *boss, const Common::String &prefix, const ExtraGuiOptions &engineOptions); +#ifdef ANDROIDSDL + void setAndroidSdlSettingsState(bool enabled); +#endif void setGraphicSettingsState(bool enabled); void setAudioSettingsState(bool enabled); void setMIDISettingsState(bool enabled); @@ -112,6 +118,16 @@ protected: int _pathsTabId; private: + +#ifdef ANDROIDSDL + // + // AndroidSDL controls + // + bool _enableAndroidSdlSettings; + + CheckboxWidget *_touchpadCheckbox; +#endif + // // Graphics controls // diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip Binary files differindex 400b997b93..175a646fd6 100644 --- a/gui/themes/scummclassic.zip +++ b/gui/themes/scummclassic.zip diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index b3100d4b92..d48f208714 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -237,6 +237,14 @@ </layout> </layout> </dialog> + + <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'> + <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> + <widget name = 'grTouchpadCheckbox' + type = 'Checkbox' + /> + </layout> + </dialog> <dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index 7879e05a97..f58cf76e23 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -234,6 +234,14 @@ </layout> </layout> </dialog> + + <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'> + <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> + <widget name = 'grTouchpadCheckbox' + type = 'Checkbox' + /> + </layout> + </dialog> <dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip Binary files differindex 673d67ed87..8eb1353e27 100644 --- a/gui/themes/scummmodern.zip +++ b/gui/themes/scummmodern.zip diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 9cadc11e13..4ac032ac67 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -251,6 +251,14 @@ </layout> </layout> </dialog> + + <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'> + <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> + <widget name = 'grTouchpadCheckbox' + type = 'Checkbox' + /> + </layout> + </dialog> <dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index 7ef5fc5ee1..f8e56f4083 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -232,6 +232,14 @@ </layout> </layout> </dialog> + + <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'> + <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> + <widget name = 'grTouchpadCheckbox' + type = 'Checkbox' + /> + </layout> + </dialog> <dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> |