diff --git a/backends/platform/android/options.cpp b/backends/platform/android/options.cpp index 315335b9dae..2ed2225feb6 100644 --- a/backends/platform/android/options.cpp +++ b/backends/platform/android/options.cpp @@ -53,6 +53,8 @@ public: // OptionsContainerWidget API void load() override; bool save() override; + bool hasKeys() override; + void setEnabled(bool e) override; private: // OptionsContainerWidget API @@ -60,10 +62,12 @@ private: GUI::CheckboxWidget *_onscreenCheckbox; GUI::CheckboxWidget *_touchpadCheckbox; + + bool _enabled; }; AndroidOptionsWidget::AndroidOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain) : - OptionsContainerWidget(boss, name, "AndroidOptionsDialog", false, domain) { + OptionsContainerWidget(boss, name, "AndroidOptionsDialog", false, domain), _enabled(true) { _onscreenCheckbox = new GUI::CheckboxWidget(widgetsBoss(), "AndroidOptionsDialog.OnScreenControl", _("Show On-screen control")); _touchpadCheckbox = new GUI::CheckboxWidget(widgetsBoss(), "AndroidOptionsDialog.TouchpadMode", _("Touchpad mouse mode")); @@ -75,7 +79,7 @@ AndroidOptionsWidget::~AndroidOptionsWidget() { void AndroidOptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const { layouts.addDialog(layoutName, overlayedLayout) .addLayout(GUI::ThemeLayout::kLayoutVertical) - .addPadding(16, 16, 16, 16) + .addPadding(0, 0, 0, 0) .addWidget("OnScreenControl", "Checkbox") .addWidget("TouchpadMode", "Checkbox") .closeLayout() @@ -88,12 +92,28 @@ void AndroidOptionsWidget::load() { } bool AndroidOptionsWidget::save() { - ConfMan.setBool("onscreen_control", _onscreenCheckbox->getState(), _domain); - ConfMan.setBool("touchpad_mouse_mode", _touchpadCheckbox->getState(), _domain); + if (_enabled) { + ConfMan.setBool("onscreen_control", _onscreenCheckbox->getState(), _domain); + ConfMan.setBool("touchpad_mouse_mode", _touchpadCheckbox->getState(), _domain); + } else { + ConfMan.removeKey("onscreen_control", _domain); + ConfMan.removeKey("touchpad_mouse_mode", _domain); + } return true; } +bool AndroidOptionsWidget::hasKeys() { + return ConfMan.hasKey("onscreen_control", _domain) || + ConfMan.hasKey("touchpad_mouse_mode", _domain); +} + +void AndroidOptionsWidget::setEnabled(bool e) { + _enabled = e; + + _onscreenCheckbox->setEnabled(e); + _touchpadCheckbox->setEnabled(e); +} GUI::OptionsContainerWidget *OSystem_Android::buildBackendOptionsWidget(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const { diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index 1baacb91920..6233856b358 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -38,7 +38,7 @@ #include "graphics/pixelformat.h" -#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.42" +#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.43" class OSystem; diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp index 3104319fb15..19eb243df05 100644 --- a/gui/editgamedialog.cpp +++ b/gui/editgamedialog.cpp @@ -65,6 +65,7 @@ enum { kCmdGlobalGraphicsOverride = 'OGFX', kCmdGlobalShaderOverride = 'OSHD', + kCmdGlobalBackendOverride = 'OBAK', kCmdGlobalAudioOverride = 'OSFX', kCmdGlobalMIDIOverride = 'OMID', kCmdGlobalMT32Override = 'OM32', @@ -245,6 +246,11 @@ EditGameDialog::EditGameDialog(const String &domain) // int backendTabId = tab->addTab(_("Backend"), "GameOptions_Backend"); + if (g_system->getOverlayWidth() > 320) + _globalBackendOverride = new CheckboxWidget(tab, "GameOptions_Backend.EnableTabCheckbox", _("Override global backend settings"), Common::U32String(), kCmdGlobalBackendOverride); + else + _globalBackendOverride = new CheckboxWidget(tab, "GameOptions_Backend.EnableTabCheckbox", _c("Override global backend settings", "lowres"), Common::U32String(), kCmdGlobalBackendOverride); + g_system->registerDefaultSettings(_domain); _backendOptions = g_system->buildBackendOptionsWidget(tab, "GameOptions_Backend.Container", _domain); @@ -410,6 +416,11 @@ void EditGameDialog::open() { _globalShaderOverride->setState(e); } + if (_backendOptions) { + e = _backendOptions->hasKeys(); + _globalBackendOverride->setState(e); + } + e = ConfMan.hasKey("music_driver", _domain) || ConfMan.hasKey("output_rate", _domain) || ConfMan.hasKey("opl_driver", _domain) || @@ -510,6 +521,10 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat setShaderSettingsState(data != 0); g_gui.scheduleTopDialogRedraw(); break; + case kCmdGlobalBackendOverride: + _backendOptions->setEnabled(data != 0); + g_gui.scheduleTopDialogRedraw(); + break; case kCmdGlobalAudioOverride: setAudioSettingsState(data != 0); setSubtitleSettingsState(data != 0); diff --git a/gui/editgamedialog.h b/gui/editgamedialog.h index d83862da978..f7916c4bcb2 100644 --- a/gui/editgamedialog.h +++ b/gui/editgamedialog.h @@ -87,6 +87,7 @@ protected: CheckboxWidget *_globalGraphicsOverride; CheckboxWidget *_globalShaderOverride; + CheckboxWidget *_globalBackendOverride; CheckboxWidget *_globalAudioOverride; CheckboxWidget *_globalMIDIOverride; CheckboxWidget *_globalMT32Override; diff --git a/gui/themes/default.inc b/gui/themes/default.inc index f1d9c2805cf..ca587c6222d 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -1667,7 +1667,7 @@ const char *defaultXML1 = "" "" "" "" -"" +"" "" "" "" @@ -2385,7 +2385,10 @@ const char *defaultXML1 = "" "" "" "" -"" +"" +"" "" "" "" @@ -2680,7 +2683,7 @@ const char *defaultXML1 = "" "" "" "" -"" +"" "" "" "" @@ -3514,7 +3517,7 @@ const char *defaultXML1 = "" "" "" "" -"" +"" "" "" "" @@ -3858,6 +3861,11 @@ const char *defaultXML1 = "" "/>" "" "" +"" +"" +"" "" "" "" -"" +"" +"" "" "" "" @@ -4536,7 +4547,7 @@ const char *defaultXML1 = "" "" "" "" -"" +"" "" "" "" diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip index 5209ffd69fd..6a8e64664a5 100644 Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ diff --git a/gui/themes/residualvm/THEMERC b/gui/themes/residualvm/THEMERC index 32a56ed4ba2..5655a76b71f 100644 --- a/gui/themes/residualvm/THEMERC +++ b/gui/themes/residualvm/THEMERC @@ -1 +1 @@ -[SCUMMVM_STX0.8.42:ResidualVM Modern Theme:No Author] +[SCUMMVM_STX0.8.43:ResidualVM Modern Theme:No Author] diff --git a/gui/themes/residualvm/residualvm_layout.stx b/gui/themes/residualvm/residualvm_layout.stx index 420e4c5450e..44dd69960d0 100644 --- a/gui/themes/residualvm/residualvm_layout.stx +++ b/gui/themes/residualvm/residualvm_layout.stx @@ -310,7 +310,7 @@ - + @@ -653,12 +653,12 @@ /> - - @@ -1049,7 +1049,10 @@ - + + @@ -1361,7 +1364,7 @@ - + diff --git a/gui/themes/residualvm/residualvm_layout_lowres.stx b/gui/themes/residualvm/residualvm_layout_lowres.stx index 90db68fcfd6..fc87b5fa24e 100644 --- a/gui/themes/residualvm/residualvm_layout_lowres.stx +++ b/gui/themes/residualvm/residualvm_layout_lowres.stx @@ -289,7 +289,7 @@ - + @@ -1034,7 +1034,10 @@ - + + @@ -1355,7 +1358,7 @@ - + diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip index f8086b70279..4a345381ebf 100644 Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC index 2c89173ddd6..b5388530f8c 100644 --- a/gui/themes/scummclassic/THEMERC +++ b/gui/themes/scummclassic/THEMERC @@ -1 +1 @@ -[SCUMMVM_STX0.8.42:ScummVM Classic Theme:No Author] +[SCUMMVM_STX0.8.43:ScummVM Classic Theme:No Author] diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index 9c67cb6b148..e3920f96527 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -294,7 +294,7 @@ - + @@ -1034,7 +1034,10 @@ - + + @@ -1346,7 +1349,7 @@ - + diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index 48475b20efb..2da592ecc8a 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -291,7 +291,7 @@ - + @@ -1035,7 +1035,10 @@ - + + @@ -1355,7 +1358,7 @@ - + diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip index 6f993a3da25..07f60b978e7 100644 Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC index 21cc0e5cbc3..87051e17aad 100644 --- a/gui/themes/scummmodern/THEMERC +++ b/gui/themes/scummmodern/THEMERC @@ -1 +1 @@ -[SCUMMVM_STX0.8.42:ScummVM Modern Theme:No Author] +[SCUMMVM_STX0.8.43:ScummVM Modern Theme:No Author] diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 046175f44fd..44dd69960d0 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -310,7 +310,7 @@ - + @@ -1049,7 +1049,10 @@ - + + @@ -1361,7 +1364,7 @@ - + diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index 90db68fcfd6..fc87b5fa24e 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -289,7 +289,7 @@ - + @@ -1034,7 +1034,10 @@ - + + @@ -1355,7 +1358,7 @@ - + diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip index 4d180033671..6fdebc552a9 100644 Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC index 59d4fbbc3c0..734f1647853 100644 --- a/gui/themes/scummremastered/THEMERC +++ b/gui/themes/scummremastered/THEMERC @@ -1 +1 @@ -[SCUMMVM_STX0.8.42:ScummVM Modern Theme Remastered:No Author] +[SCUMMVM_STX0.8.43:ScummVM Modern Theme Remastered:No Author] diff --git a/gui/themes/scummremastered/remastered_layout.stx b/gui/themes/scummremastered/remastered_layout.stx index 046175f44fd..44dd69960d0 100644 --- a/gui/themes/scummremastered/remastered_layout.stx +++ b/gui/themes/scummremastered/remastered_layout.stx @@ -310,7 +310,7 @@ - + @@ -1049,7 +1049,10 @@ - + + @@ -1361,7 +1364,7 @@ - + diff --git a/gui/themes/scummremastered/remastered_layout_lowres.stx b/gui/themes/scummremastered/remastered_layout_lowres.stx index 90db68fcfd6..fc87b5fa24e 100644 --- a/gui/themes/scummremastered/remastered_layout_lowres.stx +++ b/gui/themes/scummremastered/remastered_layout_lowres.stx @@ -289,7 +289,7 @@ - + @@ -1034,7 +1034,10 @@ - + + @@ -1355,7 +1358,7 @@ - + diff --git a/gui/widget.h b/gui/widget.h index 4af90f3b0c0..2e69af64a1d 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -476,6 +476,15 @@ public: */ virtual bool save() = 0; + /** Implementing classes should return if there are relevant keys set in the configuration domain + * + * @return true if there are relevant keys set in the configuration domain + */ + virtual bool hasKeys() { return true; } + + /** Implementing classes should enable or disable all active widgets */ + virtual void setEnabled(bool e) {} + void setParentDialog(Dialog *parentDialog) { _parentDialog = parentDialog; } void setDomain(const Common::String &domain) { _domain = domain; }