aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeEngine.h2
-rw-r--r--gui/launcher.cpp59
-rw-r--r--gui/options.cpp16
-rw-r--r--gui/options.h10
-rw-r--r--gui/themes/default.inc25
-rw-r--r--gui/themes/scummclassic.zipbin86033 -> 16136 bytes
-rw-r--r--gui/themes/scummclassic/THEMERC2
-rw-r--r--gui/themes/scummclassic/classic_layout.stx26
-rw-r--r--gui/themes/scummclassic/classic_layout_lowres.stx26
-rw-r--r--gui/themes/scummmodern.zipbin1441312 -> 713257 bytes
-rw-r--r--gui/themes/scummmodern/THEMERC2
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx26
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx26
13 files changed, 209 insertions, 11 deletions
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index f041f85ab9..42ccc57ce8 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -35,7 +35,7 @@
#include "graphics/pixelformat.h"
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.8"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.9"
class OSystem;
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index a3e4925848..1670c2da88 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -145,11 +145,28 @@ protected:
CheckboxWidget *_globalMIDIOverride;
CheckboxWidget *_globalMT32Override;
CheckboxWidget *_globalVolumeOverride;
+
+ ExtraGuiOptions _engineOptions;
};
EditGameDialog::EditGameDialog(const String &domain, const String &desc)
: OptionsDialog(domain, "GameOptions") {
-
+ // Retrieve all game specific options.
+ const EnginePlugin *plugin = 0;
+ // To allow for game domains without a gameid.
+ // TODO: Is it intentional that this is still supported?
+ String gameId(ConfMan.get("gameid", domain));
+ if (gameId.empty())
+ gameId = domain;
+ // Retrieve the plugin, since we need to access the engine's MetaEngine
+ // implementation.
+ EngineMan.findGame(gameId, &plugin);
+ if (plugin) {
+ _engineOptions = (*plugin)->getExtraGuiOptions(domain);
+ } else {
+ warning("Plugin for target \"%s\" not found! Game specific settings might be missing", domain.c_str());
+ }
+
// GAME: Path to game data (r/o), extra data (r/o), and save data (r/w)
String gamePath(ConfMan.get("path", _domain));
String extraPath(ConfMan.get("extrapath", _domain));
@@ -208,7 +225,16 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
}
//
- // 2) The graphics tab
+ // 2) The engine tab (shown only if there are custom engine options)
+ //
+ if (_engineOptions.size() > 0) {
+ tab->addTab(_("Engine"));
+
+ addEngineControls(tab, "GameOptions_Engine.", _engineOptions);
+ }
+
+ //
+ // 3) The graphics tab
//
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
@@ -220,7 +246,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
addGraphicControls(tab, "GameOptions_Graphics.");
//
- // 3) The audio tab
+ // 4) The audio tab
//
tab->addTab(_("Audio"));
@@ -233,7 +259,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
addSubtitleControls(tab, "GameOptions_Audio.");
//
- // 4) The volume tab
+ // 5) The volume tab
//
if (g_system->getOverlayWidth() > 320)
tab->addTab(_("Volume"));
@@ -248,7 +274,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
addVolumeControls(tab, "GameOptions_Volume.");
//
- // 5) The MIDI tab
+ // 6) The MIDI tab
//
if (!_guioptions.contains(GUIO_NOMIDI)) {
tab->addTab(_("MIDI"));
@@ -262,7 +288,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
}
//
- // 6) The MT-32 tab
+ // 7) The MT-32 tab
//
if (!_guioptions.contains(GUIO_NOMIDI)) {
tab->addTab(_("MT-32"));
@@ -276,7 +302,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
}
//
- // 7) The Paths tab
+ // 8) The Paths tab
//
if (g_system->getOverlayWidth() > 320)
tab->addTab(_("Paths"));
@@ -311,7 +337,6 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
_savePathClearButton = addClearButton(tab, "GameOptions_Paths.SavePathClearButton", kCmdSavePathClear);
-
// Activate the first tab
tab->setActiveTab(0);
_tabWidget = tab;
@@ -386,6 +411,19 @@ void EditGameDialog::open() {
_langPopUp->setEnabled(false);
}
+ // Set the state of engine-specific checkboxes
+ for (uint j = 0; j < _engineOptions.size(); ++j) {
+ // The default values for engine-specific checkboxes are not set when
+ // ScummVM starts, as this would require us to load and poll all of the
+ // engine plugins on startup. Thus, we set the state of each custom
+ // option checkbox to what is specified by the engine plugin, and
+ // update it only if a value has been set in the configuration of the
+ // currently selected game.
+ bool isChecked = _engineOptions[j].defaultState;
+ if (ConfMan.hasKey(_engineOptions[j].configOption, _domain))
+ isChecked = ConfMan.getBool(_engineOptions[j].configOption, _domain);
+ _engineCheckboxes[j]->setState(isChecked);
+ }
const Common::PlatformDescription *p = Common::g_platforms;
const Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", _domain));
@@ -429,6 +467,11 @@ void EditGameDialog::close() {
ConfMan.removeKey("platform", _domain);
else
ConfMan.set("platform", Common::getPlatformCode(platform), _domain);
+
+ // Set the state of engine-specific checkboxes
+ for (uint i = 0; i < _engineOptions.size(); i++) {
+ ConfMan.setBool(_engineOptions[i].configOption, _engineCheckboxes[i]->getState(), _domain);
+ }
}
OptionsDialog::close();
}
diff --git a/gui/options.cpp b/gui/options.cpp
index 6747195a1b..9386e9811f 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -997,6 +997,22 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre
_enableVolumeSettings = true;
}
+void OptionsDialog::addEngineControls(GuiObject *boss, const Common::String &prefix, const ExtraGuiOptions &engineOptions) {
+ // Note: up to 7 engine options can currently fit on screen (the most that
+ // can fit in a 320x200 screen with the classic theme).
+ // TODO: Increase this number by including the checkboxes inside a scroll
+ // widget. The appropriate number of checkboxes will need to be added to
+ // the theme files.
+
+ uint i = 1;
+ ExtraGuiOptions::const_iterator iter;
+ for (iter = engineOptions.begin(); iter != engineOptions.end(); ++iter, ++i) {
+ Common::String id = Common::String::format("%d", i);
+ _engineCheckboxes.push_back(new CheckboxWidget(boss,
+ prefix + "customOption" + id + "Checkbox", _(iter->label), _(iter->tooltip)));
+ }
+}
+
bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String setting, MusicType preferredType) {
if (!popup || !popup->isEnabled())
return true;
diff --git a/gui/options.h b/gui/options.h
index 05b3cac617..796e9fbd7c 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -22,6 +22,8 @@
#ifndef OPTIONS_DIALOG_H
#define OPTIONS_DIALOG_H
+#include "engines/metaengine.h"
+
#include "gui/dialog.h"
#include "common/str.h"
#include "audio/mididrv.h"
@@ -44,6 +46,8 @@ class RadiobuttonGroup;
class RadiobuttonWidget;
class OptionsDialog : public Dialog {
+ typedef Common::Array<CheckboxWidget *> CheckboxWidgetList;
+
public:
OptionsDialog(const Common::String &domain, int x, int y, int w, int h);
OptionsDialog(const Common::String &domain, const Common::String &name);
@@ -74,6 +78,7 @@ protected:
// The default value is the launcher's non-scaled talkspeed value. When SCUMM uses the widget,
// it uses its own scale
void addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal = 255);
+ void addEngineControls(GuiObject *boss, const Common::String &prefix, const ExtraGuiOptions &engineOptions);
void setGraphicSettingsState(bool enabled);
void setAudioSettingsState(bool enabled);
@@ -181,6 +186,11 @@ protected:
//Theme Options
//
Common::String _oldTheme;
+
+ //
+ // Engine-specific controls
+ //
+ CheckboxWidgetList _engineCheckboxes;
};
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index bd28c2e85d..f6096ce342 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1187,6 +1187,31 @@
"</layout> "
"</layout> "
"</dialog> "
+"<dialog name = 'GameOptions_Engine' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'> "
+"<layout type = 'vertical' padding = '16, 16, 16, 16'> "
+"<widget name = 'customOption1Checkbox' "
+"type = 'Checkbox' "
+"/> "
+"<widget name = 'customOption2Checkbox' "
+"type = 'Checkbox' "
+"/> "
+"<widget name = 'customOption3Checkbox' "
+"type = 'Checkbox' "
+"/> "
+"<widget name = 'customOption4Checkbox' "
+"type = 'Checkbox' "
+"/> "
+"<widget name = 'customOption5Checkbox' "
+"type = 'Checkbox' "
+"/> "
+"<widget name = 'customOption6Checkbox' "
+"type = 'Checkbox' "
+"/> "
+"<widget name = 'customOption7Checkbox' "
+"type = 'Checkbox' "
+"/> "
+"</layout> "
+"</dialog> "
"<dialog name='GlobalMenu' overlays='screen_center'> "
"<layout type='vertical' padding='2,2,4,6' center='true' spacing='6'> "
"<widget name='Title' "
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index d4cfd0cba3..9f7e4b5e0e 100644
--- a/gui/themes/scummclassic.zip
+++ b/gui/themes/scummclassic.zip
Binary files differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index f3904cbb6d..fb8177f329 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.8:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8.9:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 9da42635a7..bdccea418b 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -627,6 +627,32 @@
</layout>
</dialog>
+ <dialog name = 'GameOptions_Engine' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16'>
+ <widget name = 'customOption1Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption2Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption3Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption4Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption5Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption6Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption7Checkbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
+
<dialog name = 'GlobalMenu' overlays = 'screen_center'>
<layout type = 'vertical' padding = '16, 16, 16, 16' center = 'true'>
<widget name = 'Title'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index dc528a4c00..87246023c4 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -639,6 +639,32 @@
</layout>
</dialog>
+ <dialog name = 'GameOptions_Engine' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'>
+ <layout type = 'vertical' padding = '8, 8, 8, 8'>
+ <widget name = 'customOption1Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption2Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption3Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption4Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption5Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption6Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption7Checkbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
+
<dialog name = 'GlobalMenu' overlays = 'screen_center'>
<layout type = 'vertical' padding = '2, 2, 4, 6' center = 'true' spacing='6'>
<widget name = 'Title'
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index fc4c89cbcc..56dc162a0a 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index 32bd36241e..628ab67f42 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.8:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8.9:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 69ad9c79fa..6acccebccc 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -642,6 +642,32 @@
</layout>
</dialog>
+ <dialog name = 'GameOptions_Engine' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16'>
+ <widget name = 'customOption1Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption2Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption3Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption4Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption5Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption6Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption7Checkbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
+
<dialog name = 'GlobalMenu' overlays = 'screen_center'>
<layout type = 'vertical' padding = '16, 16, 16, 16' center = 'true'>
<widget name = 'Logo'
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 0bfd16c1d9..49aad1070a 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -637,6 +637,32 @@
</layout>
</dialog>
+ <dialog name = 'GameOptions_Engine' overlays = 'Dialog.GameOptions.TabWidget' shading = 'dim'>
+ <layout type = 'vertical' padding = '8, 8, 8, 8'>
+ <widget name = 'customOption1Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption2Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption3Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption4Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption5Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption6Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'customOption7Checkbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
+
<dialog name = 'GlobalMenu' overlays = 'screen_center'>
<layout type = 'vertical' padding = '4, 4, 4, 4' center = 'true' spacing='2'>
<widget name = 'Title'