From bb788e054b69c1d0232e867932a59b2c8722e1a1 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Thu, 3 Nov 2022 21:37:50 +0000 Subject: [PATCH] SHERLOCK: Move the engine options into the MetaEngine subclass --- engines/sherlock/POTFILES | 2 +- engines/sherlock/detection.cpp | 104 +------------------------------- engines/sherlock/detection.h | 11 ++++ engines/sherlock/metaengine.cpp | 94 +++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 104 deletions(-) diff --git a/engines/sherlock/POTFILES b/engines/sherlock/POTFILES index 2748b07516b..b4bfa040d91 100644 --- a/engines/sherlock/POTFILES +++ b/engines/sherlock/POTFILES @@ -1,4 +1,4 @@ engines/sherlock/detection_tables.h -engines/sherlock/detection.cpp +engines/sherlock/metaengine.cpp engines/sherlock/scalpel/scalpel.cpp engines/sherlock/tattoo/widget_files.cpp diff --git a/engines/sherlock/detection.cpp b/engines/sherlock/detection.cpp index 53a5169ae91..f7e61db06f1 100644 --- a/engines/sherlock/detection.cpp +++ b/engines/sherlock/detection.cpp @@ -39,114 +39,12 @@ static const DebugChannelDef debugFlagList[] = { DEBUG_CHANNEL_END }; - -#define GAMEOPTION_ORIGINAL_SAVES GUIO_GAMEOPTIONS1 -#define GAMEOPTION_FADE_STYLE GUIO_GAMEOPTIONS2 -#define GAMEOPTION_HELP_STYLE GUIO_GAMEOPTIONS3 -#define GAMEOPTION_PORTRAITS_ON GUIO_GAMEOPTIONS4 -#define GAMEOPTION_WINDOW_STYLE GUIO_GAMEOPTIONS5 -#define GAMEOPTION_TRANSPARENT_WINDOWS GUIO_GAMEOPTIONS6 - -#ifdef USE_TTS -#define GAMEOPTION_TTS_NARRATOR GUIO_GAMEOPTIONS7 -#endif - -static const ADExtraGuiOptionsMap optionsList[] = { - { - GAMEOPTION_ORIGINAL_SAVES, - { - _s("Use original save/load screens"), - _s("Use the original save/load screens instead of the ScummVM ones"), - "originalsaveload", - false, - 0, - 0 - } - }, - - { - GAMEOPTION_FADE_STYLE, - { - _s("Pixellated scene transitions"), - _s("When changing scenes, a randomized pixel transition is done"), - "fade_style", - true, - 0, - 0 - } - }, - - { - GAMEOPTION_HELP_STYLE, - { - _s("Don't show hotspots when moving mouse"), - _s("Only show hotspot names after you actually click on a hotspot or action button"), - "help_style", - false, - 0, - 0 - } - }, - - { - GAMEOPTION_PORTRAITS_ON, - { - _s("Show character portraits"), - _s("Show portraits for the characters when conversing"), - "portraits_on", - true, - 0, - 0 - } - }, - - { - GAMEOPTION_WINDOW_STYLE, - { - _s("Slide dialogs into view"), - _s("Slide UI dialogs into view, rather than simply showing them immediately"), - "window_style", - true, - 0, - 0 - } - }, - - { - GAMEOPTION_TRANSPARENT_WINDOWS, - { - _s("Transparent windows"), - _s("Show windows with a partially transparent background"), - "transparent_windows", - true, - 0, - 0 - } - }, - -#ifdef USE_TTS - { - GAMEOPTION_TTS_NARRATOR, - { - _s("TTS Narrator"), - _s("Use TTS to read the descriptions (if TTS is available)"), - "tts_narrator", - false, - 0, - 0 - } - }, -#endif - AD_EXTRA_GUI_OPTIONS_TERMINATOR -}; - - #include "sherlock/detection_tables.h" class SherlockMetaEngineDetection : public AdvancedMetaEngineDetection { public: SherlockMetaEngineDetection() : AdvancedMetaEngineDetection(Sherlock::gameDescriptions, sizeof(Sherlock::SherlockGameDescription), - sherlockGames, optionsList) {} + sherlockGames) {} const char *getName() const override { return "sherlock"; diff --git a/engines/sherlock/detection.h b/engines/sherlock/detection.h index f80814fe3bf..3ac34c2a170 100644 --- a/engines/sherlock/detection.h +++ b/engines/sherlock/detection.h @@ -37,6 +37,17 @@ struct SherlockGameDescription { GameType gameID; }; +#define GAMEOPTION_ORIGINAL_SAVES GUIO_GAMEOPTIONS1 +#define GAMEOPTION_FADE_STYLE GUIO_GAMEOPTIONS2 +#define GAMEOPTION_HELP_STYLE GUIO_GAMEOPTIONS3 +#define GAMEOPTION_PORTRAITS_ON GUIO_GAMEOPTIONS4 +#define GAMEOPTION_WINDOW_STYLE GUIO_GAMEOPTIONS5 +#define GAMEOPTION_TRANSPARENT_WINDOWS GUIO_GAMEOPTIONS6 + +#ifdef USE_TTS +#define GAMEOPTION_TTS_NARRATOR GUIO_GAMEOPTIONS7 +#endif + } // End of namespace Sherlock #endif // SHERLOCK_DETECTION_H diff --git a/engines/sherlock/metaengine.cpp b/engines/sherlock/metaengine.cpp index 83afdca1eac..1d4d3ec9693 100644 --- a/engines/sherlock/metaengine.cpp +++ b/engines/sherlock/metaengine.cpp @@ -25,12 +25,102 @@ #include "sherlock/tattoo/tattoo.h" #include "common/system.h" +#include "common/translation.h" #include "engines/advancedDetector.h" #include "sherlock/detection.h" namespace Sherlock { +static const ADExtraGuiOptionsMap optionsList[] = { + { + GAMEOPTION_ORIGINAL_SAVES, + { + _s("Use original save/load screens"), + _s("Use the original save/load screens instead of the ScummVM ones"), + "originalsaveload", + false, + 0, + 0 + } + }, + + { + GAMEOPTION_FADE_STYLE, + { + _s("Pixellated scene transitions"), + _s("When changing scenes, a randomized pixel transition is done"), + "fade_style", + true, + 0, + 0 + } + }, + + { + GAMEOPTION_HELP_STYLE, + { + _s("Don't show hotspots when moving mouse"), + _s("Only show hotspot names after you actually click on a hotspot or action button"), + "help_style", + false, + 0, + 0 + } + }, + + { + GAMEOPTION_PORTRAITS_ON, + { + _s("Show character portraits"), + _s("Show portraits for the characters when conversing"), + "portraits_on", + true, + 0, + 0 + } + }, + + { + GAMEOPTION_WINDOW_STYLE, + { + _s("Slide dialogs into view"), + _s("Slide UI dialogs into view, rather than simply showing them immediately"), + "window_style", + true, + 0, + 0 + } + }, + + { + GAMEOPTION_TRANSPARENT_WINDOWS, + { + _s("Transparent windows"), + _s("Show windows with a partially transparent background"), + "transparent_windows", + true, + 0, + 0 + } + }, + +#ifdef USE_TTS + { + GAMEOPTION_TTS_NARRATOR, + { + _s("TTS Narrator"), + _s("Use TTS to read the descriptions (if TTS is available)"), + "tts_narrator", + false, + 0, + 0 + } + }, +#endif + AD_EXTRA_GUI_OPTIONS_TERMINATOR +}; + GameType SherlockEngine::getGameID() const { return _gameDescription->gameID; } @@ -52,6 +142,10 @@ public: return "sherlock"; } + const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override { + return Sherlock::optionsList; + } + /** * Creates an instance of the game engine */