From 3079652bad130d35d3ff5ecc8ac83f059a31c9f7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 20 Nov 2022 15:39:13 +0100 Subject: [PATCH] DEVTOOLS: CREATE_ENGINE: Added GUIO example to the generated engine skeleton --- devtools/create_engine/create_engine.cpp | 2 +- devtools/create_engine/files/POTFILES | 1 + devtools/create_engine/files/detection.h | 4 +++- devtools/create_engine/files/metaengine.cpp | 25 +++++++++++++++++++++ devtools/create_engine/files/metaengine.h | 2 ++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 devtools/create_engine/files/POTFILES diff --git a/devtools/create_engine/create_engine.cpp b/devtools/create_engine/create_engine.cpp index a8a0d96d497..768bb9a939d 100644 --- a/devtools/create_engine/create_engine.cpp +++ b/devtools/create_engine/create_engine.cpp @@ -45,7 +45,7 @@ static const char *const FILENAMES[] = { "credits.pl", "detection.cpp", "detection.h", "detection_tables.h", "metaengine.cpp", "metaengine.h", "module.mk", "xyzzy.cpp", - "xyzzy.h", nullptr + "xyzzy.h", "POTFILES", nullptr }; const char *const ENGINES = "create_project ..\\.. --use-canonical-lib-names --msvc\n"; diff --git a/devtools/create_engine/files/POTFILES b/devtools/create_engine/files/POTFILES new file mode 100644 index 00000000000..5fd15403ba1 --- /dev/null +++ b/devtools/create_engine/files/POTFILES @@ -0,0 +1 @@ +engines/xyzzy/metaengine.cpp diff --git a/devtools/create_engine/files/detection.h b/devtools/create_engine/files/detection.h index 1b9d86b750c..83fbbcb6cd8 100644 --- a/devtools/create_engine/files/detection.h +++ b/devtools/create_engine/files/detection.h @@ -38,7 +38,9 @@ extern const PlainGameDescriptor xyzzyGames[]; extern const ADGameDescription gameDescriptions[]; -} // namespace Xyzzy +#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1 + +} // End of namespace Xyzzy class XyzzyMetaEngineDetection : public AdvancedMetaEngineDetection { static const DebugChannelDef debugFlagList[]; diff --git a/devtools/create_engine/files/metaengine.cpp b/devtools/create_engine/files/metaengine.cpp index 3931ee262ed..5b409a47fb9 100644 --- a/devtools/create_engine/files/metaengine.cpp +++ b/devtools/create_engine/files/metaengine.cpp @@ -19,14 +19,39 @@ * */ +#include "common/translation.h" + #include "xyzzy/metaengine.h" #include "xyzzy/detection.h" #include "xyzzy/xyzzy.h" +namespace Xyzzy { + +static const ADExtraGuiOptionsMap optionsList[] = { + { + GAMEOPTION_ORIGINAL_SAVELOAD, + { + _s("Use original save/load screens"), + _s("Use the original save/load screens instead of the ScummVM ones"), + "original_menus", + false, + 0, + 0 + } + }, + AD_EXTRA_GUI_OPTIONS_TERMINATOR +}; + +} // End of namespace Xyzzy + const char *XyzzyMetaEngine::getName() const { return "xyzzy"; } +const ADExtraGuiOptionsMap *XyzzyMetaEngine::getAdvancedExtraGuiOptions() const { + return Xyzzy::optionsList; +} + Common::Error XyzzyMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { *engine = new Xyzzy::XyzzyEngine(syst, desc); return Common::kNoError; diff --git a/devtools/create_engine/files/metaengine.h b/devtools/create_engine/files/metaengine.h index 903eea46281..dc6562bcf0c 100644 --- a/devtools/create_engine/files/metaengine.h +++ b/devtools/create_engine/files/metaengine.h @@ -37,6 +37,8 @@ public: * Used by e.g. the launcher to determine whether to enable the Load button. */ bool hasFeature(MetaEngineFeature f) const override; + + const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override; }; #endif // XYZZY_METAENGINE_H