Refactor GUI options update into a function in Common: updateGameGUIOptions.
svn-id: r42446
This commit is contained in:
parent
88e0fc2c43
commit
51a9bfc9e2
4 changed files with 18 additions and 14 deletions
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "common/util.h"
|
||||
#include "common/system.h"
|
||||
#include "common/config-manager.h"
|
||||
#include "gui/debugger.h"
|
||||
#include "engines/engine.h"
|
||||
|
||||
|
@ -420,6 +421,14 @@ String getGameGUIOptionsDescription(uint32 options) {
|
|||
return res;
|
||||
}
|
||||
|
||||
void updateGameGUIOptions(const uint32 options) {
|
||||
if ((options && !ConfMan.hasKey("guioptions")) ||
|
||||
(ConfMan.hasKey("guioptions") && options != parseGameGUIOptions(ConfMan.get("guioptions")))) {
|
||||
ConfMan.set("guioptions", getGameGUIOptionsDescription(options));
|
||||
ConfMan.flushToDisk();
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Common
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue