diff options
-rw-r--r-- | base/plugins.cpp | 5 | ||||
-rw-r--r-- | engines/game.h | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp index f6bbeacf74..f4d18efb1c 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -580,6 +580,11 @@ Common::String EngineManager::createTargetForGame(const DetectedGame &game) { addStringToConf("extra", game.extra, domain); addStringToConf("guioptions", game.getGUIOptions(), domain); + // Add any extra configuration keys + for (Common::StringMap::iterator i = game._extraConfigEntries.begin(); + i != game._extraConfigEntries.end(); ++i) + addStringToConf((*i)._key, (*i)._value, domain); + // TODO: Setting the description field here has the drawback // that the user does never notice when we upgrade our descriptions. // It might be nice to leave this field empty, and only set it to diff --git a/engines/game.h b/engines/game.h index 14f9962ce6..304166d05f 100644 --- a/engines/game.h +++ b/engines/game.h @@ -148,6 +148,21 @@ struct DetectedGame { */ GameSupportLevel gameSupportLevel; + /** + * A list of extra keys to write to the configuration file + */ + Common::StringMap _extraConfigEntries; + + /** + * Allows adding of extra entries to be saved as part of the detection entry + * in the configuration file. + * @remarks Any entry added using this should not be relied on being present + * in the configuration file, since starting games directly from the + * command line bypasses the game detection code + */ + void addExtraEntry(const Common::String &key, const Common::String &value) { + _extraConfigEntries[key] = value; + } private: /** * Update the description string by appending (EXTRA/PLATFORM/LANG) to it. |