From 9f2d6d82ca05c4dfe5e649bcda4586c78cb420f3 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sat, 7 Feb 2009 06:47:19 +0000 Subject: Make the subtitle settings in Options section of the global main menu optional, and enable only for game engines where subtitles settings are synced. svn-id: r36237 --- engines/dialogs.cpp | 12 +++++++----- engines/dialogs.h | 2 +- engines/engine.h | 6 ++++++ engines/queen/queen.cpp | 3 ++- engines/scumm/detection.cpp | 3 ++- engines/sword2/sword2.cpp | 3 ++- engines/touche/detection.cpp | 3 ++- 7 files changed, 22 insertions(+), 10 deletions(-) diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 4729b248a0..410b5e8d4d 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -109,7 +109,7 @@ MainMenuDialog::MainMenuDialog(Engine *engine) new GUI::ButtonWidget(this, "GlobalMenu.Quit", "Quit", kQuitCmd, 'Q'); _aboutDialog = new GUI::AboutDialog(); - _optionsDialog = new ConfigDialog(); + _optionsDialog = new ConfigDialog(_engine->hasFeature(Engine::kSupportsSubtitleOptions)); _loadDialog = new GUI::SaveLoadChooser("Load game:", "Load"); _loadDialog->setSaveMode(false); _saveDialog = new GUI::SaveLoadChooser("Save game:", "Save"); @@ -269,7 +269,7 @@ enum { // These changes will achieve two things at once: Allow us to get rid of using // "" as value for the domain, and in fact provide a somewhat better user // experience at the same time. -ConfigDialog::ConfigDialog() +ConfigDialog::ConfigDialog(bool subtitleControls) : GUI::OptionsDialog("", "ScummConfig") { // @@ -279,11 +279,13 @@ ConfigDialog::ConfigDialog() addVolumeControls(this, "ScummConfig."); // - // Some misc options + // Subtitle speed and toggle controllers // - // SCUMM has a talkspeed range of 0-9 - addSubtitleControls(this, "ScummConfig.", 9); + if (subtitleControls) { + // Global talkspeed range of 0-255 + addSubtitleControls(this, "ScummConfig.", 255); + } // // Add the buttons diff --git a/engines/dialogs.h b/engines/dialogs.h index b71ae84149..bd2f9dce84 100644 --- a/engines/dialogs.h +++ b/engines/dialogs.h @@ -66,7 +66,7 @@ protected: #endif public: - ConfigDialog(); + ConfigDialog(bool subtitleControls); ~ConfigDialog(); virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); diff --git a/engines/engine.h b/engines/engine.h index a67f5f6637..bcf398a813 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -102,6 +102,12 @@ public: * @see Engine::hasFeature() */ enum EngineFeature { + /** + * Enables the subtitle speed and toggle items in the Options section + * of the global main menu. + */ + kSupportsSubtitleOptions, + /** * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled * either directly, or indirectly (that is, the engine calls and honors diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index e0241fb014..b8523a9a53 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -85,7 +85,8 @@ bool QueenMetaEngine::hasFeature(MetaEngineFeature f) const { bool Queen::QueenEngine::hasFeature(EngineFeature f) const { return - (f == kSupportsRTL); + (f == kSupportsRTL) || + (f == kSupportsSubtitleOptions); } GameList QueenMetaEngine::getSupportedGames() const { diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 4da4bf1ec3..f25c3e8c36 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -711,7 +711,8 @@ bool ScummEngine::hasFeature(EngineFeature f) const { return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || - (f == kSupportsSavingDuringRuntime); + (f == kSupportsSavingDuringRuntime) || + (f == kSupportsSubtitleOptions); } GameList ScummMetaEngine::getSupportedGames() const { diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index edf6d8edf8..9fdc10123d 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -100,7 +100,8 @@ bool Sword2MetaEngine::hasFeature(MetaEngineFeature f) const { bool Sword2::Sword2Engine::hasFeature(EngineFeature f) const { return - (f == kSupportsRTL); + (f == kSupportsRTL) || + (f == kSupportsSubtitleOptions); } GameList Sword2MetaEngine::getSupportedGames() const { diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 462b6c9ca4..4a82ee0cfe 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -155,7 +155,8 @@ bool Touche::ToucheEngine::hasFeature(EngineFeature f) const { return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || - (f == kSupportsSavingDuringRuntime); + (f == kSupportsSavingDuringRuntime) || + (f == kSupportsSubtitleOptions); } bool ToucheMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { -- cgit v1.2.3