diff options
-rw-r--r-- | backends/platform/androidsdl/androidsdl-sdl.cpp | 6 | ||||
-rw-r--r-- | backends/platform/androidsdl/androidsdl-sdl.h | 1 | ||||
-rw-r--r-- | common/system.h | 20 | ||||
-rw-r--r-- | gui/options.cpp | 76 | ||||
-rw-r--r-- | gui/options.h | 11 | ||||
-rw-r--r-- | gui/themes/default.inc | 2 | ||||
-rw-r--r-- | gui/themes/scummclassic.zip | bin | 127377 -> 127371 bytes | |||
-rw-r--r-- | gui/themes/scummclassic/classic_layout.stx | 2 | ||||
-rw-r--r-- | gui/themes/scummclassic/classic_layout_lowres.stx | 2 | ||||
-rw-r--r-- | gui/themes/scummmodern.zip | bin | 1646917 -> 1646989 bytes | |||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout.stx | 2 | ||||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout_lowres.stx | 2 |
12 files changed, 66 insertions, 58 deletions
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp index 07bb23eba6..61b01920bb 100644 --- a/backends/platform/androidsdl/androidsdl-sdl.cpp +++ b/backends/platform/androidsdl/androidsdl-sdl.cpp @@ -113,3 +113,9 @@ bool OSystem_ANDROIDSDL::getFeatureState(Feature f) { break; } } + +bool OSystem_ANDROIDSDL::hasFeature(Feature f) { + return (f == kFeatureTouchpadMode || + f == kFeatureOnScreenControl || + f == OSystem_POSIX::getFeatureState(f)); +} diff --git a/backends/platform/androidsdl/androidsdl-sdl.h b/backends/platform/androidsdl/androidsdl-sdl.h index 36925ec275..4976e320df 100644 --- a/backends/platform/androidsdl/androidsdl-sdl.h +++ b/backends/platform/androidsdl/androidsdl-sdl.h @@ -30,6 +30,7 @@ public: virtual void initBackend(); virtual void setFeatureState(Feature f, bool enable); virtual bool getFeatureState(Feature f); + virtual bool hasFeature(Feature f); void touchpadMode(bool enable); void switchToDirectMouseMode(); void switchToRelativeMouseMode(); diff --git a/common/system.h b/common/system.h index a481884ea8..eda4ec6b10 100644 --- a/common/system.h +++ b/common/system.h @@ -336,19 +336,17 @@ public: * * This feature has no associated state. */ - kFeatureOpenUrl - -#ifdef ANDROIDSDL - , - /** - * show on-screen control - */ + kFeatureOpenUrl , + + /** + * show on-screen control + */ kFeatureOnScreenControl, - /** - * mouse emulation mode - */ + + /** + * mouse emulation mode + */ kFeatureTouchpadMode -#endif }; /** 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 = "<?xml version = '1.0'?>" "</layout>" "</dialog>" -"<dialog name='GlobalOptions_AndroidSdl' overlays='Dialog.GlobalOptions.TabWidget'>" +"<dialog name='GlobalOptions_Control' overlays='Dialog.GlobalOptions.TabWidget'>" "<layout type='vertical' padding='16,16,16,16' spacing='8'>" "<widget name='grOnScreenCheckbox' " "type='Checkbox' " diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip Binary files differindex 733668e5d6..22eaa76fde 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 f85020824d..a1a148b0c7 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -238,7 +238,7 @@ </layout> </dialog> - <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'> + <dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'grOnScreenCheckbox' type = 'Checkbox' diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index b660b4a8f5..1627ee6ce2 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -235,7 +235,7 @@ </layout> </dialog> - <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'> + <dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'grOnScreenCheckbox' type = 'Checkbox' diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip Binary files differindex 1779d22d44..a42d6ed620 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 49fb4813a4..16e85a0761 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -252,7 +252,7 @@ </layout> </dialog> - <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'> + <dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'grOnScreenCheckbox' type = 'Checkbox' diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index 4a74704c34..a2d51d9904 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -233,7 +233,7 @@ </layout> </dialog> - <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'> + <dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'> <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'> <widget name = 'grOnScreenCheckbox' type = 'Checkbox' |