aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/util.cpp9
-rw-r--r--common/util.h7
2 files changed, 16 insertions, 0 deletions
diff --git a/common/util.cpp b/common/util.cpp
index e99bbeb12d..869cec4c48 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -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
diff --git a/common/util.h b/common/util.h
index e50dcebff0..aeadcd1483 100644
--- a/common/util.h
+++ b/common/util.h
@@ -284,6 +284,13 @@ bool checkGameGUIOption(GameGUIOption option, const String &str);
uint32 parseGameGUIOptions(const String &str);
String getGameGUIOptionsDescription(uint32 options);
+/**
+ * Updates the GUI options of the current config manager
+ * domain, when they differ to the ones passed as
+ * parameter.
+ */
+void updateGameGUIOptions(const uint32 options);
+
} // End of namespace Common