KYRA: Move the engine options into the MetaEngine subclass

This commit is contained in:
Cameron Cawley 2022-11-03 21:02:47 +00:00 committed by Eugene Sandulenko
parent a7cfc03df0
commit ca29054d6b
4 changed files with 135 additions and 131 deletions

View File

@ -50,130 +50,11 @@ const char *const directoryGlobs[] = {
nullptr
};
const ADExtraGuiOptionsMap gameGuiOptions[] = {
// Kyrandia 3 options
{
GAMEOPTION_KYRA3_AUDIENCE,
{
// I18N: Studio audience adds an applause and cheering sounds whenever
// Malcolm makes a joke.
_s("Studio audience"),
_s("Enable studio audience"),
"studio_audience",
true,
0,
0
}
},
{
GAMEOPTION_KYRA3_SKIP,
{
// I18N: This option allows the user to skip text and cutscenes.
_s("Skip support"),
_s("Allow text and cutscenes to be skipped"),
"skip_support",
true,
0,
0
}
},
{
GAMEOPTION_KYRA3_HELIUM,
{
// I18N: Helium mode makes people sound like they've inhaled Helium.
_s("Helium mode"),
_s("Enable helium mode"),
"helium_mode",
false,
0,
0
}
},
// LoL options
{
GAMEOPTION_LOL_SCROLLING,
{
// I18N: When enabled, this option makes scrolling smoother when
// changing from one screen to another.
_s("Smooth scrolling"),
_s("Enable smooth scrolling when walking"),
"smooth_scrolling",
true,
0,
0
}
},
{
GAMEOPTION_LOL_CURSORS,
{
// I18N: When enabled, this option changes the cursor when it floats to the
// edge of the screen to a directional arrow. The player can then click to
// walk towards that direction.
_s("Floating cursors"),
_s("Enable floating cursors"),
"floating_cursors",
false,
0,
0
}
},
{
GAMEOPTION_LOL_SAVENAMES,
{
// I18N: When enabled, this option will fill in an autogenerated savegame
// description into the input prompt where.
_s("Suggest save names"),
_s("Autogenerated naming suggestions for savegames"),
"auto_savenames",
false,
0,
0
}
},
// EoB options
{
GAMEOPTION_EOB_HPGRAPHS,
{
// I18N: HP stands for Hit Points
_s("HP bar graphs"),
_s("Enable hit point bar graphs"),
"hpbargraphs",
true,
0,
0
}
},
{
GAMEOPTION_EOB_MOUSESWAP,
{
// I18N: L/R stands for Left/Right
_s("Fight Button L/R Swap"),
_s("Left button to attack, right button to pick up items"),
"mousebtswap",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
} // End of anonymous namespace
class KyraMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
KyraMetaEngineDetection() : AdvancedMetaEngineDetection(adGameDescs, sizeof(KYRAGameDescription), gameList, gameGuiOptions) {
KyraMetaEngineDetection() : AdvancedMetaEngineDetection(adGameDescs, sizeof(KYRAGameDescription), gameList) {
_md5Bytes = 1024 * 1024;
_maxScanDepth = 2;
_directoryGlobs = directoryGlobs;

View File

@ -70,6 +70,17 @@ struct KYRAGameDescription {
Kyra::GameFlags flags;
};
#define GAMEOPTION_KYRA3_AUDIENCE GUIO_GAMEOPTIONS1
#define GAMEOPTION_KYRA3_SKIP GUIO_GAMEOPTIONS2
#define GAMEOPTION_KYRA3_HELIUM GUIO_GAMEOPTIONS3
#define GAMEOPTION_LOL_SCROLLING GUIO_GAMEOPTIONS4
#define GAMEOPTION_LOL_CURSORS GUIO_GAMEOPTIONS5
#define GAMEOPTION_LOL_SAVENAMES GUIO_GAMEOPTIONS8
#define GAMEOPTION_EOB_HPGRAPHS GUIO_GAMEOPTIONS6
#define GAMEOPTION_EOB_MOUSESWAP GUIO_GAMEOPTIONS7
} // End of anonymous namespace
#endif // KYRA_DETECTION_H

View File

@ -67,17 +67,6 @@ namespace {
#define EOB2_FLAGS FLAGS(false, false, false, false, false, false, false, false, false, Kyra::GI_EOB2)
#define EOB2_FMTOWNS_FLAGS FLAGS(false, false, false, false, true, false, true, false, false, Kyra::GI_EOB2)
#define GAMEOPTION_KYRA3_AUDIENCE GUIO_GAMEOPTIONS1
#define GAMEOPTION_KYRA3_SKIP GUIO_GAMEOPTIONS2
#define GAMEOPTION_KYRA3_HELIUM GUIO_GAMEOPTIONS3
#define GAMEOPTION_LOL_SCROLLING GUIO_GAMEOPTIONS4
#define GAMEOPTION_LOL_CURSORS GUIO_GAMEOPTIONS5
#define GAMEOPTION_LOL_SAVENAMES GUIO_GAMEOPTIONS8
#define GAMEOPTION_EOB_HPGRAPHS GUIO_GAMEOPTIONS6
#define GAMEOPTION_EOB_MOUSESWAP GUIO_GAMEOPTIONS7
static const char msg_missingLangResources[] = _s("Missing language specific game code and/or resources.");
static const char msg_fanTrans_missingLangResources[] = _s("Missing language specific game code and/or resources for this fan translation.");
static const char msg_fanTrans_unsupportiveTranslator[] = _s("The fan translator does not wish his translation to be incorporated into ScummVM.");

View File

@ -37,12 +37,135 @@
#include "kyra/detection.h"
const ADExtraGuiOptionsMap gameGuiOptions[] = {
// Kyrandia 3 options
{
GAMEOPTION_KYRA3_AUDIENCE,
{
// I18N: Studio audience adds an applause and cheering sounds whenever
// Malcolm makes a joke.
_s("Studio audience"),
_s("Enable studio audience"),
"studio_audience",
true,
0,
0
}
},
{
GAMEOPTION_KYRA3_SKIP,
{
// I18N: This option allows the user to skip text and cutscenes.
_s("Skip support"),
_s("Allow text and cutscenes to be skipped"),
"skip_support",
true,
0,
0
}
},
{
GAMEOPTION_KYRA3_HELIUM,
{
// I18N: Helium mode makes people sound like they've inhaled Helium.
_s("Helium mode"),
_s("Enable helium mode"),
"helium_mode",
false,
0,
0
}
},
// LoL options
{
GAMEOPTION_LOL_SCROLLING,
{
// I18N: When enabled, this option makes scrolling smoother when
// changing from one screen to another.
_s("Smooth scrolling"),
_s("Enable smooth scrolling when walking"),
"smooth_scrolling",
true,
0,
0
}
},
{
GAMEOPTION_LOL_CURSORS,
{
// I18N: When enabled, this option changes the cursor when it floats to the
// edge of the screen to a directional arrow. The player can then click to
// walk towards that direction.
_s("Floating cursors"),
_s("Enable floating cursors"),
"floating_cursors",
false,
0,
0
}
},
{
GAMEOPTION_LOL_SAVENAMES,
{
// I18N: When enabled, this option will fill in an autogenerated savegame
// description into the input prompt where.
_s("Suggest save names"),
_s("Autogenerated naming suggestions for savegames"),
"auto_savenames",
false,
0,
0
}
},
// EoB options
{
GAMEOPTION_EOB_HPGRAPHS,
{
// I18N: HP stands for Hit Points
_s("HP bar graphs"),
_s("Enable hit point bar graphs"),
"hpbargraphs",
true,
0,
0
}
},
{
GAMEOPTION_EOB_MOUSESWAP,
{
// I18N: L/R stands for Left/Right
_s("Fight Button L/R Swap"),
_s("Left button to attack, right button to pick up items"),
"mousebtswap",
false,
0,
0
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
class KyraMetaEngine : public AdvancedMetaEngine {
public:
const char *getName() const override {
return "kyra";
}
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override {
return gameGuiOptions;
}
bool hasFeature(MetaEngineFeature f) const override;
Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;