Fix update of GUI options, which only differ in the language setting.

svn-id: r50706
This commit is contained in:
Johannes Schickel 2010-07-05 20:10:56 +00:00
parent 73e51735a4
commit 1443a2721c
4 changed files with 10 additions and 7 deletions

View File

@ -365,12 +365,15 @@ const String getGameGUIOptionsDescription(uint32 options) {
return res;
}
void updateGameGUIOptions(const uint32 options) {
void updateGameGUIOptions(const uint32 options, const String &langOption) {
const String newOptionString = getGameGUIOptionsDescription(options) + " " + langOption;
if ((options && !ConfMan.hasKey("guioptions")) ||
(ConfMan.hasKey("guioptions") && options != parseGameGUIOptions(ConfMan.get("guioptions")))) {
ConfMan.set("guioptions", getGameGUIOptionsDescription(options));
(ConfMan.hasKey("guioptions") && ConfMan.get("guioptions") != newOptionString)) {
ConfMan.set("guioptions", newOptionString);
ConfMan.flushToDisk();
}
}
} // End of namespace Common
} // End of namespace Common

View File

@ -240,7 +240,7 @@ const String getGameGUIOptionsDescriptionLanguage(Language lang);
* domain, when they differ to the ones passed as
* parameter.
*/
void updateGameGUIOptions(const uint32 options);
void updateGameGUIOptions(const uint32 options, const String &langOption);
} // End of namespace Common

View File

@ -306,7 +306,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
// If the GUI options were updated, we catch this here and update them in the users config
// file transparently.
Common::updateGameGUIOptions(agdDesc->guioptions | params.guioptions);
Common::updateGameGUIOptions(agdDesc->guioptions | params.guioptions, getGameGUIOptionsDescriptionLanguage(agdDesc->language));
debug(2, "Running %s", toGameDescriptor(*agdDesc, params.list).description().c_str());
if (!createInstance(syst, engine, agdDesc))

View File

@ -1024,7 +1024,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co
// If the GUI options were updated, we catch this here and update them in the users config
// file transparently.
Common::updateGameGUIOptions(res.game.guioptions);
Common::updateGameGUIOptions(res.game.guioptions, getGameGUIOptionsDescriptionLanguage(res.language));
// Finally, we have massaged the GameDescriptor to our satisfaction, and can
// instantiate the appropriate game engine. Hooray!