From 15acee29f19c845dc534d2c8af48a449ea1cd380 Mon Sep 17 00:00:00 2001 From: lubomyr Date: Mon, 30 Jan 2017 22:35:40 +0200 Subject: ANDROIDSDL: implemented checkbox for change mouse mode in Options menu --- gui/options.cpp | 41 +++++++++++++++++++++ gui/options.h | 16 ++++++++ gui/themes/scummclassic.zip | Bin 126739 -> 127241 bytes gui/themes/scummclassic/classic_layout.stx | 8 ++++ gui/themes/scummclassic/classic_layout_lowres.stx | 8 ++++ gui/themes/scummmodern.zip | Bin 1646279 -> 1646781 bytes gui/themes/scummmodern/scummmodern_layout.stx | 8 ++++ .../scummmodern/scummmodern_layout_lowres.stx | 8 ++++ 8 files changed, 89 insertions(+) (limited to 'gui') 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 index 400b997b93..175a646fd6 100644 Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ 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 @@ + + + + + + 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 @@ + + + + + + diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip index 673d67ed87..8eb1353e27 100644 Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ 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 @@ + + + + + + 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 @@ + + + + + + -- cgit v1.2.3 From 2aa0cdcff67bf423fd7eb5ed8b50749930d32a0f Mon Sep 17 00:00:00 2001 From: lubomyr Date: Tue, 31 Jan 2017 20:36:54 +0200 Subject: ANDROIDSDL: fixed in-game menu crash, removed unused method --- gui/options.cpp | 7 ++----- gui/options.h | 3 --- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index ffce01fc1e..30ca132516 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -211,7 +211,8 @@ void OptionsDialog::build() { // AndroidSDL options if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) { bool touchpadState = ConfMan.getBool("touchpad_mouse_mode", _domain); - _touchpadCheckbox->setState(touchpadState); + if (_touchpadCheckbox != 0) + _touchpadCheckbox->setState(touchpadState); } #endif @@ -693,10 +694,6 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data } } -void OptionsDialog::setAndroidSdlSettingsState(bool enabled) { - _enableAndroidSdlSettings = enabled; -} - void OptionsDialog::setGraphicSettingsState(bool enabled) { _enableGraphicSettings = enabled; diff --git a/gui/options.h b/gui/options.h index e6bb195b41..046e9acf6d 100644 --- a/gui/options.h +++ b/gui/options.h @@ -99,9 +99,6 @@ 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); -- cgit v1.2.3 From 9cdda5c045bed4d3a8fe5fc841225f735624e341 Mon Sep 17 00:00:00 2001 From: lubomyr Date: Tue, 31 Jan 2017 22:44:50 +0200 Subject: ANDROIDSDL: implemented checkbox for show/hide on-screen control in Options menu --- gui/options.cpp | 14 +++++++++++++- gui/options.h | 1 + gui/themes/default.inc | 12 ++++++++++++ gui/themes/scummclassic.zip | Bin 127241 -> 127377 bytes gui/themes/scummclassic/classic_layout.stx | 3 +++ gui/themes/scummclassic/classic_layout_lowres.stx | 3 +++ gui/themes/scummmodern.zip | Bin 1646781 -> 1646917 bytes gui/themes/scummmodern/scummmodern_layout.stx | 3 +++ .../scummmodern/scummmodern_layout_lowres.stx | 3 +++ 9 files changed, 38 insertions(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index 30ca132516..4b2765698f 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -138,6 +138,7 @@ OptionsDialog::~OptionsDialog() { void OptionsDialog::init() { #ifdef ANDROIDSDL _enableAndroidSdlSettings = false; + _onscreenCheckbox = 0; _touchpadCheckbox = 0; #endif _enableGraphicSettings = false; @@ -209,6 +210,11 @@ void OptionsDialog::build() { #ifdef ANDROIDSDL // AndroidSDL options + if (ConfMan.hasKey("onscreen_control", _domain)) { + bool onscreenState = ConfMan.getBool("onscreen_control", _domain); + if (_onscreenCheckbox != 0) + _onscreenCheckbox->setState(onscreenState); + } if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) { bool touchpadState = ConfMan.getBool("touchpad_mouse_mode", _domain); if (_touchpadCheckbox != 0) @@ -395,6 +401,10 @@ void OptionsDialog::open() { void OptionsDialog::apply() { #ifdef ANDROIDSDL if (_enableAndroidSdlSettings) { + if (ConfMan.getBool("onscreen_control", _domain) != _onscreenCheckbox->getState()) { + ConfMan.setBool("onscreen_control", _onscreenCheckbox->getState(), _domain); + g_system->setFeatureState(OSystem::kFeatureOnScreenControl, _onscreenCheckbox->getState()); + } if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) { ConfMan.setBool("touchpad_mouse_mode", _touchpadCheckbox->getState(), _domain); g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState()); @@ -822,9 +832,11 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) { #ifdef ANDROIDSDL void OptionsDialog::addAndroidSdlControls(GuiObject *boss, const Common::String &prefix) { + // Show On-Screen control + _onscreenCheckbox = new CheckboxWidget(boss, prefix + "grOnScreenCheckbox", _("Show On-screen control")); // Touchpad Mouse mode _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode")); - + _enableAndroidSdlSettings = true; } #endif diff --git a/gui/options.h b/gui/options.h index 046e9acf6d..3189c91982 100644 --- a/gui/options.h +++ b/gui/options.h @@ -123,6 +123,7 @@ private: bool _enableAndroidSdlSettings; CheckboxWidget *_touchpadCheckbox; + CheckboxWidget *_onscreenCheckbox; #endif // diff --git a/gui/themes/default.inc b/gui/themes/default.inc index a83fd788ad..54c63703b0 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -813,6 +813,18 @@ const char *defaultXML1 = "" "" "" "" + +"" +"" +"" +"" +"" +"" + "" "" "" diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip index 175a646fd6..733668e5d6 100644 Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index d48f208714..f85020824d 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -240,6 +240,9 @@ + diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index f58cf76e23..b660b4a8f5 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -237,6 +237,9 @@ + diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip index 8eb1353e27..1779d22d44 100644 Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 4ac032ac67..49fb4813a4 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -254,6 +254,9 @@ + diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index f8e56f4083..4a74704c34 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -235,6 +235,9 @@ + -- cgit v1.2.3 From f8c4274f1a0bdde91123f3cd493d14e5a1b1a91e Mon Sep 17 00:00:00 2001 From: lubomyr Date: Tue, 7 Feb 2017 16:35:41 +0200 Subject: ANDROIDSDL: code refactoring... --- gui/options.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index 4b2765698f..b7d9ddaec2 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -211,12 +211,12 @@ void OptionsDialog::build() { #ifdef ANDROIDSDL // AndroidSDL options if (ConfMan.hasKey("onscreen_control", _domain)) { - bool onscreenState = ConfMan.getBool("onscreen_control", _domain); + bool onscreenState = g_system->getFeatureState(OSystem::kFeatureOnScreenControl); if (_onscreenCheckbox != 0) _onscreenCheckbox->setState(onscreenState); } if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) { - bool touchpadState = ConfMan.getBool("touchpad_mouse_mode", _domain); + bool touchpadState = g_system->getFeatureState(OSystem::kFeatureTouchpadMode); if (_touchpadCheckbox != 0) _touchpadCheckbox->setState(touchpadState); } @@ -402,11 +402,9 @@ void OptionsDialog::apply() { #ifdef ANDROIDSDL if (_enableAndroidSdlSettings) { if (ConfMan.getBool("onscreen_control", _domain) != _onscreenCheckbox->getState()) { - ConfMan.setBool("onscreen_control", _onscreenCheckbox->getState(), _domain); g_system->setFeatureState(OSystem::kFeatureOnScreenControl, _onscreenCheckbox->getState()); } if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) { - ConfMan.setBool("touchpad_mouse_mode", _touchpadCheckbox->getState(), _domain); g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState()); } } -- cgit v1.2.3 From 216f9c4f11cd95f9e4ed049c9ecc97304e83f837 Mon Sep 17 00:00:00 2001 From: lubomyr Date: Tue, 14 Feb 2017 15:13:58 +0200 Subject: ANDROIDSDL: backend related checking in options.cpp replaced with hasFeature... condition, renamed some fields and methods --- gui/options.cpp | 76 +++++++++++---------- gui/options.h | 11 ++- gui/themes/default.inc | 2 +- gui/themes/scummclassic.zip | Bin 127377 -> 127371 bytes gui/themes/scummclassic/classic_layout.stx | 2 +- gui/themes/scummclassic/classic_layout_lowres.stx | 2 +- gui/themes/scummmodern.zip | Bin 1646917 -> 1646989 bytes gui/themes/scummmodern/scummmodern_layout.stx | 2 +- .../scummmodern/scummmodern_layout_lowres.stx | 2 +- 9 files changed, 50 insertions(+), 47 deletions(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index b7d9ddaec2..fdd5db4c32 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -136,11 +136,9 @@ OptionsDialog::~OptionsDialog() { } void OptionsDialog::init() { -#ifdef ANDROIDSDL - _enableAndroidSdlSettings = false; + _enableControlSettings = false; _onscreenCheckbox = 0; _touchpadCheckbox = 0; -#endif _enableGraphicSettings = false; _gfxPopUp = 0; _gfxPopUpDesc = 0; @@ -208,19 +206,21 @@ void OptionsDialog::build() { _guioptions = parseGameGUIOptions(_guioptionsString); } -#ifdef ANDROIDSDL - // AndroidSDL options - if (ConfMan.hasKey("onscreen_control", _domain)) { - bool onscreenState = g_system->getFeatureState(OSystem::kFeatureOnScreenControl); - if (_onscreenCheckbox != 0) - _onscreenCheckbox->setState(onscreenState); - } - if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) { - bool touchpadState = g_system->getFeatureState(OSystem::kFeatureTouchpadMode); - if (_touchpadCheckbox != 0) - _touchpadCheckbox->setState(touchpadState); + // Control options + if (g_system->hasFeature(OSystem::kFeatureOnScreenControl)) { + if (ConfMan.hasKey("onscreen_control", _domain)) { + bool onscreenState = g_system->getFeatureState(OSystem::kFeatureOnScreenControl); + if (_onscreenCheckbox != 0) + _onscreenCheckbox->setState(onscreenState); + } + } + if (g_system->hasFeature(OSystem::kFeatureTouchpadMode)) { + if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) { + bool touchpadState = g_system->getFeatureState(OSystem::kFeatureTouchpadMode); + if (_touchpadCheckbox != 0) + _touchpadCheckbox->setState(touchpadState); + } } -#endif // Graphic options if (_fullscreenCheckbox) { @@ -399,16 +399,20 @@ void OptionsDialog::open() { } void OptionsDialog::apply() { -#ifdef ANDROIDSDL - if (_enableAndroidSdlSettings) { - if (ConfMan.getBool("onscreen_control", _domain) != _onscreenCheckbox->getState()) { - g_system->setFeatureState(OSystem::kFeatureOnScreenControl, _onscreenCheckbox->getState()); + // Control options + if (_enableControlSettings) { + if (g_system->hasFeature(OSystem::kFeatureOnScreenControl)) { + if (ConfMan.getBool("onscreen_control", _domain) != _onscreenCheckbox->getState()) { + g_system->setFeatureState(OSystem::kFeatureOnScreenControl, _onscreenCheckbox->getState()); + } } - if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) { - g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState()); + if (g_system->hasFeature(OSystem::kFeatureTouchpadMode)) { + if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) { + g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState()); + } } } -#endif + // Graphic options bool graphicsModeChanged = false; if (_fullscreenCheckbox) { @@ -828,16 +832,17 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) { _subSpeedLabel->setEnabled(ena); } -#ifdef ANDROIDSDL - void OptionsDialog::addAndroidSdlControls(GuiObject *boss, const Common::String &prefix) { + void OptionsDialog::addControlControls(GuiObject *boss, const Common::String &prefix) { // Show On-Screen control - _onscreenCheckbox = new CheckboxWidget(boss, prefix + "grOnScreenCheckbox", _("Show On-screen control")); + if (g_system->hasFeature(OSystem::kFeatureOnScreenControl)) + _onscreenCheckbox = new CheckboxWidget(boss, prefix + "grOnScreenCheckbox", _("Show On-screen control")); + // Touchpad Mouse mode - _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode")); - - _enableAndroidSdlSettings = true; + if (g_system->hasFeature(OSystem::kFeatureTouchpadMode)) + _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode")); + + _enableControlSettings = true; } -#endif void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &prefix) { const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes(); @@ -1265,14 +1270,15 @@ GlobalOptionsDialog::~GlobalOptionsDialog() { void GlobalOptionsDialog::build() { // The tab widget TabWidget *tab = new TabWidget(this, "GlobalOptions.TabWidget"); - -#ifdef ANDROIDSDL + // - // The control tab only for Android SDL platform + // The control tab (currently visible only for AndroidSDL platform, visibility checking by features // - tab->addTab(_("Control")); - addAndroidSdlControls(tab, "GlobalOptions_AndroidSdl."); -#endif + if (g_system->hasFeature(OSystem::kFeatureTouchpadMode) || + g_system->hasFeature(OSystem::kFeatureOnScreenControl)) { + tab->addTab(_("Control")); + addControlControls(tab, "GlobalOptions_Control."); + } // // 1) The graphics tab diff --git a/gui/options.h b/gui/options.h index 3189c91982..cb86e265bb 100644 --- a/gui/options.h +++ b/gui/options.h @@ -86,9 +86,8 @@ protected: virtual void clean(); void rebuild(); -#ifdef ANDROIDSDL - void addAndroidSdlControls(GuiObject *boss, const Common::String &prefix); -#endif + + void addControlControls(GuiObject *boss, const Common::String &prefix); void addGraphicControls(GuiObject *boss, const Common::String &prefix); void addAudioControls(GuiObject *boss, const Common::String &prefix); void addMIDIControls(GuiObject *boss, const Common::String &prefix); @@ -116,15 +115,13 @@ protected: private: -#ifdef ANDROIDSDL // - // AndroidSDL controls + // Control controls // - bool _enableAndroidSdlSettings; + bool _enableControlSettings; CheckboxWidget *_touchpadCheckbox; CheckboxWidget *_onscreenCheckbox; -#endif // // Graphics controls diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 54c63703b0..9254e97f40 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -814,7 +814,7 @@ const char *defaultXML1 = "" "" "" -"" +"" "" " - + - + - + - + 127529 bytes gui/themes/scummclassic/classic_layout.stx | 3 +++ gui/themes/scummclassic/classic_layout_lowres.stx | 3 +++ gui/themes/scummmodern.zip | Bin 1646989 -> 1647069 bytes gui/themes/scummmodern/scummmodern_layout.stx | 3 +++ .../scummmodern/scummmodern_layout_lowres.stx | 3 +++ 9 files changed, 48 insertions(+), 3 deletions(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index fdd5db4c32..056476f170 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -139,6 +139,7 @@ void OptionsDialog::init() { _enableControlSettings = false; _onscreenCheckbox = 0; _touchpadCheckbox = 0; + _swapMenuAndBackBtnsCheckbox = 0; _enableGraphicSettings = false; _gfxPopUp = 0; _gfxPopUpDesc = 0; @@ -221,6 +222,13 @@ void OptionsDialog::build() { _touchpadCheckbox->setState(touchpadState); } } + if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) { + if (ConfMan.hasKey("swap_menu_and_back", _domain)) { + bool state = g_system->getFeatureState(OSystem::kFeatureSwapMenuAndBackButtons); + if (_swapMenuAndBackBtnsCheckbox != 0) + _swapMenuAndBackBtnsCheckbox->setState(state); + } + } // Graphic options if (_fullscreenCheckbox) { @@ -411,6 +419,11 @@ void OptionsDialog::apply() { g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState()); } } + if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) { + if (ConfMan.getBool("swap_menu_and_back", _domain) != _swapMenuAndBackBtnsCheckbox->getState()) { + g_system->setFeatureState(OSystem::kFeatureSwapMenuAndBackButtons, _swapMenuAndBackBtnsCheckbox->getState()); + } + } } // Graphic options @@ -841,6 +854,10 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) { if (g_system->hasFeature(OSystem::kFeatureTouchpadMode)) _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode")); + // Swap menu and back buttons + if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) + _swapMenuAndBackBtnsCheckbox = new CheckboxWidget(boss, prefix + "grSwapMenuAndBackBtnsCheckbox", _("Swap Menu and Back buttons")); + _enableControlSettings = true; } @@ -1275,7 +1292,8 @@ void GlobalOptionsDialog::build() { // The control tab (currently visible only for AndroidSDL platform, visibility checking by features // if (g_system->hasFeature(OSystem::kFeatureTouchpadMode) || - g_system->hasFeature(OSystem::kFeatureOnScreenControl)) { + g_system->hasFeature(OSystem::kFeatureOnScreenControl) || + g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) { tab->addTab(_("Control")); addControlControls(tab, "GlobalOptions_Control."); } diff --git a/gui/options.h b/gui/options.h index cb86e265bb..626ffaf2db 100644 --- a/gui/options.h +++ b/gui/options.h @@ -122,6 +122,7 @@ private: CheckboxWidget *_touchpadCheckbox; CheckboxWidget *_onscreenCheckbox; + CheckboxWidget *_swapMenuAndBackBtnsCheckbox; // // Graphics controls diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 9254e97f40..d8baae8d0e 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -813,7 +813,6 @@ const char *defaultXML1 = "" "" "" "" - "" "" "" +"" "" "" - "" "" "" @@ -2367,6 +2368,19 @@ const char *defaultXML1 = "" "" "" "" +"" +"" +"" +"" +"" +"" +"" "" "" "" diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip index 22eaa76fde..d90289a4be 100644 Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index a1a148b0c7..aa91cdb35f 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -246,6 +246,9 @@ + diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index 1627ee6ce2..c925a39d18 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -243,6 +243,9 @@ + diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip index a42d6ed620..f10102503e 100644 Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 16e85a0761..80b913a3a4 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -260,6 +260,9 @@ + diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index a2d51d9904..308ba44b7e 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -241,6 +241,9 @@ + -- cgit v1.2.3 From 3f921c1195e1a998d7dc0c423bf7eb4c9549c78f Mon Sep 17 00:00:00 2001 From: lubomyr Date: Sat, 18 Feb 2017 18:02:46 +0200 Subject: ANDROIDSDL: config feature swap_menu_and_back renamed to swap_menu_and_back_buttons --- gui/options.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gui') diff --git a/gui/options.cpp b/gui/options.cpp index 056476f170..9fe93b4007 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -223,7 +223,7 @@ void OptionsDialog::build() { } } if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) { - if (ConfMan.hasKey("swap_menu_and_back", _domain)) { + if (ConfMan.hasKey("swap_menu_and_back_buttons", _domain)) { bool state = g_system->getFeatureState(OSystem::kFeatureSwapMenuAndBackButtons); if (_swapMenuAndBackBtnsCheckbox != 0) _swapMenuAndBackBtnsCheckbox->setState(state); @@ -420,7 +420,7 @@ void OptionsDialog::apply() { } } if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) { - if (ConfMan.getBool("swap_menu_and_back", _domain) != _swapMenuAndBackBtnsCheckbox->getState()) { + if (ConfMan.getBool("swap_menu_and_back_buttons", _domain) != _swapMenuAndBackBtnsCheckbox->getState()) { g_system->setFeatureState(OSystem::kFeatureSwapMenuAndBackButtons, _swapMenuAndBackBtnsCheckbox->getState()); } } -- cgit v1.2.3