COMMON: more flexible gui options handling
This allows the meta engines to post process the gui options, before they get to be used in the GUI. This allows adding or removing options on a larger scale without having to modify each detection entry individually. In this case, it is meant to be used in the SCUMM engine, to allow adding render mode gui options wothout modifying the tables.
This commit is contained in:
parent
bea701bb8c
commit
a84336c583
2 changed files with 34 additions and 2 deletions
|
@ -250,7 +250,15 @@ void OptionsDialog::init() {
|
|||
_guioptions.clear();
|
||||
if (ConfMan.hasKey("guioptions", _domain)) {
|
||||
_guioptionsString = ConfMan.get("guioptions", _domain);
|
||||
_guioptions = parseGameGUIOptions(_guioptionsString);
|
||||
|
||||
const Plugin *plugin = nullptr;
|
||||
EngineMan.findTarget(_domain, &plugin);
|
||||
if (plugin) {
|
||||
const MetaEngineDetection &metaEngineDetection = plugin->get<MetaEngineDetection>();
|
||||
_guioptions = metaEngineDetection.parseAndCustomizeGuiOptions(_guioptionsString, _domain);
|
||||
} else {
|
||||
_guioptions = parseGameGUIOptions(_guioptionsString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,7 +267,15 @@ void OptionsDialog::build() {
|
|||
_guioptions.clear();
|
||||
if (ConfMan.hasKey("guioptions", _domain)) {
|
||||
_guioptionsString = ConfMan.get("guioptions", _domain);
|
||||
_guioptions = parseGameGUIOptions(_guioptionsString);
|
||||
|
||||
const Plugin *plugin = nullptr;
|
||||
EngineMan.findTarget(_domain, &plugin);
|
||||
if (plugin) {
|
||||
const MetaEngineDetection &metaEngineDetection = plugin->get<MetaEngineDetection>();
|
||||
_guioptions = metaEngineDetection.parseAndCustomizeGuiOptions(_guioptionsString, _domain);
|
||||
} else {
|
||||
_guioptions = parseGameGUIOptions(_guioptionsString);
|
||||
}
|
||||
}
|
||||
|
||||
// Control options
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue