From 6a49d3eadd7555a4f5f539ceb73fdfe370fce9da Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 31 Mar 2012 13:55:03 +0300 Subject: ENGINES: Return all available custom GUI options if no target is specified This is used to set default settings for all custom game options when an engine starts --- engines/advancedDetector.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'engines/advancedDetector.cpp') diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index dc7f7e007c..ac06e74e0a 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -171,12 +171,21 @@ const ExtraGuiOptions AdvancedMetaEngine::getExtraGuiOptions(const Common::Strin if (!_extraGuiOptions) return ExtraGuiOptions(); + ExtraGuiOptions options; + + // If there isn't any target specified, return all available GUI options. + // Only used when an engine starts in order to set option defaults. + if (target.empty()) { + for (const ADExtraGuiOptionsMap *entry = _extraGuiOptions; entry->guioFlag; ++entry) + options.push_back(entry->option); + + return options; + } + // Query the GUI options const Common::String guiOptionsString = ConfMan.get("guioptions", target); const Common::String guiOptions = parseGameGUIOptions(guiOptionsString); - ExtraGuiOptions options; - // Add all the applying extra GUI options. for (const ADExtraGuiOptionsMap *entry = _extraGuiOptions; entry->guioFlag; ++entry) { if (guiOptions.contains(entry->guioFlag)) -- cgit v1.2.3