diff --git a/binaries/data/mods/mod/gui/modmod/modmod.js b/binaries/data/mods/mod/gui/modmod/modmod.js index 1d0b6d2e2f..18e229adae 100644 --- a/binaries/data/mods/mod/gui/modmod/modmod.js +++ b/binaries/data/mods/mod/gui/modmod/modmod.js @@ -155,8 +155,7 @@ function initGUIButtons(data) function saveMods() { sortEnabledMods(); - Engine.ConfigDB_CreateValue("user", "mod.enabledmods", ["mod"].concat(g_ModsEnabled).join(" ")); - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "mod.enabledmods", ["mod"].concat(g_ModsEnabled).join(" ")); Engine.GetGUIObjectByName("saveConfigurationButton").enabled = false; } diff --git a/binaries/data/mods/public/gui/common/campaigns/CampaignRun.js b/binaries/data/mods/public/gui/common/campaigns/CampaignRun.js index 151a386e03..37a5a37fdd 100644 --- a/binaries/data/mods/public/gui/common/campaigns/CampaignRun.js +++ b/binaries/data/mods/public/gui/common/campaigns/CampaignRun.js @@ -38,8 +38,7 @@ class CampaignRun static clearCurrentRun() { - Engine.ConfigDB_RemoveValue("user", "currentcampaign"); - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); + Engine.ConfigDB_RemoveValueAndSave("user", "currentcampaign"); } constructor(name = "") diff --git a/binaries/data/mods/public/gui/gamesetup/Controllers/PlayerAssignmentsController.js b/binaries/data/mods/public/gui/gamesetup/Controllers/PlayerAssignmentsController.js index f420a547c3..771fab92e5 100644 --- a/binaries/data/mods/public/gui/gamesetup/Controllers/PlayerAssignmentsController.js +++ b/binaries/data/mods/public/gui/gamesetup/Controllers/PlayerAssignmentsController.js @@ -14,7 +14,7 @@ class PlayerAssignmentsController let name = singleplayerName(); // Replace empty player name when entering a single-player match for the first time. - Engine.ConfigDB_CreateAndWriteValueToFile("user", this.ConfigNameSingleplayer, name, "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", this.ConfigNameSingleplayer, name); // By default, assign the player to the first slot. g_PlayerAssignments = { diff --git a/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/TipsPanel.js b/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/TipsPanel.js index e1b465f040..607c2026ea 100644 --- a/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/TipsPanel.js +++ b/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/TipsPanel.js @@ -24,11 +24,11 @@ class TipsPanel onPress() { - Engine.ConfigDB_CreateAndWriteValueToFile( + Engine.ConfigDB_CreateAndSaveValue( "user", this.Config, - String(this.displaySPTips.checked), - "config/user.cfg"); + String(this.displaySPTips.checked) + ); } onGameSettingsPanelResize(settingsPanel) diff --git a/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js b/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js index 1fbd2227b0..8765a730f8 100644 --- a/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js +++ b/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js @@ -347,9 +347,9 @@ function startHost(playername, servername, port, password) { startConnectionStatus("server"); - Engine.ConfigDB_CreateAndWriteValueToFile("user", "playername.multiplayer", playername, "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "playername.multiplayer", playername); - Engine.ConfigDB_CreateAndWriteValueToFile("user", "multiplayerhosting.port", port, "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "multiplayerhosting.port", port); let hostFeedback = Engine.GetGUIObjectByName("hostFeedback"); @@ -415,9 +415,9 @@ function startJoin(playername, ip, port) Engine.LobbySetPlayerPresence("playing"); // Only save the player name and host address if they're valid. - Engine.ConfigDB_CreateAndWriteValueToFile("user", "playername.multiplayer", playername, "config/user.cfg"); - Engine.ConfigDB_CreateAndWriteValueToFile("user", "multiplayerserver", ip, "config/user.cfg"); - Engine.ConfigDB_CreateAndWriteValueToFile("user", "multiplayerjoining.port", port, "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "playername.multiplayer", playername); + Engine.ConfigDB_CreateAndSaveValue("user", "multiplayerserver", ip); + Engine.ConfigDB_CreateAndSaveValue("user", "multiplayerjoining.port", port); return true; } diff --git a/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.xml b/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.xml index 98cab62d88..9f682a7477 100644 --- a/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.xml +++ b/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.xml @@ -122,7 +122,7 @@ - Engine.ConfigDB_CreateAndWriteValueToFile("user", "lobby.stun.enabled", String(this.checked), "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "lobby.stun.enabled", String(this.checked)); Use STUN to work around firewalls diff --git a/binaries/data/mods/public/gui/hotkeys/HotkeyPicker.js b/binaries/data/mods/public/gui/hotkeys/HotkeyPicker.js index 424b079f4f..ceb686c61d 100644 --- a/binaries/data/mods/public/gui/hotkeys/HotkeyPicker.js +++ b/binaries/data/mods/public/gui/hotkeys/HotkeyPicker.js @@ -30,8 +30,7 @@ class HotkeyPicker Engine.GetGUIObjectByName("hotkeyPickerReset").onPress = () => { // This is a bit "using a bazooka to kill a fly" - Engine.ConfigDB_RemoveValue("user", "hotkey." + this.name); - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); + Engine.ConfigDB_RemoveValueAndSave("user", "hotkey." + this.name); Engine.ReloadHotkeys(); let data = Engine.GetHotkeyMap(); this.combinations = data[this.name]; diff --git a/binaries/data/mods/public/gui/hotkeys/HotkeysPage.js b/binaries/data/mods/public/gui/hotkeys/HotkeysPage.js index 35ba030751..9b125ab51d 100644 --- a/binaries/data/mods/public/gui/hotkeys/HotkeysPage.js +++ b/binaries/data/mods/public/gui/hotkeys/HotkeysPage.js @@ -163,7 +163,7 @@ class HotkeysPage this.categories[cat].hotkeys.forEach(([name, _]) => { Engine.ConfigDB_RemoveValue("user", "hotkey." + name); }); - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); + Engine.ConfigDB_SaveChanges("user"); Engine.ReloadHotkeys(); this.saveButton.enabled = false; this.setupHotkeyData(); @@ -184,7 +184,7 @@ class HotkeysPage if (keymap.join("") !== formatHotkeyCombinations(defaultData[hotkey], false).join("")) Engine.ConfigDB_CreateValues("user", "hotkey." + hotkey, keymap); } - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); + Engine.ConfigDB_SaveChanges("user"); Engine.ReloadHotkeys(); } } diff --git a/binaries/data/mods/public/gui/lobby/LobbyPage/Buttons/BuddyButton.js b/binaries/data/mods/public/gui/lobby/LobbyPage/Buttons/BuddyButton.js index 25de3579a3..db71b622ef 100644 --- a/binaries/data/mods/public/gui/lobby/LobbyPage/Buttons/BuddyButton.js +++ b/binaries/data/mods/public/gui/lobby/LobbyPage/Buttons/BuddyButton.js @@ -53,11 +53,11 @@ class BuddyButton else g_Buddies.push(this.playerName); - Engine.ConfigDB_CreateAndWriteValueToFile( + Engine.ConfigDB_CreateAndSaveValue( "user", "lobby.buddies", - g_Buddies.filter(nick => nick).join(g_BuddyListDelimiter) || g_BuddyListDelimiter, - "config/user.cfg"); + g_Buddies.filter(nick => nick).join(g_BuddyListDelimiter) || g_BuddyListDelimiter + ); this.rebuild(); diff --git a/binaries/data/mods/public/gui/options/options.js b/binaries/data/mods/public/gui/options/options.js index 5e50fa3979..a0a480c39d 100644 --- a/binaries/data/mods/public/gui/options/options.js +++ b/binaries/data/mods/public/gui/options/options.js @@ -292,7 +292,6 @@ function displayOptions() const hasChanges = Engine.ConfigDB_HasChanges("user"); Engine.ConfigDB_CreateValue("user", option.config, String(value)); - Engine.ConfigDB_SetChanges("user", true); g_ChangedKeys.add(option.config); fireConfigChangeHandlers(new Set([option.config])); @@ -374,16 +373,17 @@ function reallySetDefaults() g_ChangedKeys.add(option.config); } - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); + Engine.ConfigDB_SaveChanges("user"); revertChanges(); } function revertChange(option, oldValue, hadChanges) { + Engine.ConfigDB_CreateValue("user", option.config, String(oldValue)); + if (!hadChanges) Engine.ConfigDB_SetChanges("user", false); - Engine.ConfigDB_CreateValue("user", option.config, String(oldValue)); if (option.function) Engine[option.function](oldValue); @@ -393,7 +393,6 @@ function revertChange(option, oldValue, hadChanges) function revertChanges() { Engine.ConfigDB_Reload("user"); - Engine.ConfigDB_SetChanges("user", false); for (let category in g_Options) for (let option of g_Options[category].options) @@ -436,8 +435,7 @@ function saveChanges() function reallySaveChanges() { - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); - Engine.ConfigDB_SetChanges("user", false); + Engine.ConfigDB_SaveChanges("user"); enableButtons(); } diff --git a/binaries/data/mods/public/gui/prelobby/common/credentials/credentials.js b/binaries/data/mods/public/gui/prelobby/common/credentials/credentials.js index cf91a4741c..1177d56512 100644 --- a/binaries/data/mods/public/gui/prelobby/common/credentials/credentials.js +++ b/binaries/data/mods/public/gui/prelobby/common/credentials/credentials.js @@ -56,10 +56,10 @@ function toggleRememberPassword() [translate("No"), translate("Yes")], [ () => { checkbox.checked = true; }, - () => { Engine.ConfigDB_CreateAndWriteValueToFile("user", "lobby.rememberpassword", String(!enabled), "config/user.cfg"); } + () => { Engine.ConfigDB_CreateAndSaveValue("user", "lobby.rememberpassword", String(!enabled)); } ]); else - Engine.ConfigDB_CreateAndWriteValueToFile("user", "lobby.rememberpassword", String(!enabled), "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "lobby.rememberpassword", String(!enabled)); } function getEncryptedPassword() @@ -78,14 +78,13 @@ function getEncryptedPassword() function saveCredentials() { let username = Engine.GetGUIObjectByName("username").caption; - Engine.ConfigDB_CreateAndWriteValueToFile("user", "playername.multiplayer", username, "config/user.cfg"); - Engine.ConfigDB_CreateAndWriteValueToFile("user", "lobby.login", username, "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "playername.multiplayer", username); + Engine.ConfigDB_CreateAndSaveValue("user", "lobby.login", username); if (Engine.ConfigDB_GetValue("user", "lobby.rememberpassword") == "true") - Engine.ConfigDB_CreateAndWriteValueToFile("user", "lobby.password", getEncryptedPassword(), "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "lobby.password", getEncryptedPassword()); else { - Engine.ConfigDB_RemoveValue("user", "lobby.password"); - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); + Engine.ConfigDB_RemoveValueAndSave("user", "lobby.password"); } } diff --git a/binaries/data/mods/public/gui/session/AutoFormation.js b/binaries/data/mods/public/gui/session/AutoFormation.js index b3a2420149..08b1a81570 100644 --- a/binaries/data/mods/public/gui/session/AutoFormation.js +++ b/binaries/data/mods/public/gui/session/AutoFormation.js @@ -38,10 +38,7 @@ class AutoFormation this.defaultFormation = formation; if (formation !== NULL_FORMATION) this.lastDefault = this.defaultFormation; - Engine.ConfigDB_CreateValue("user", "gui.session.defaultformation", this.defaultFormation); - // TODO: It's extremely terrible that we have to explicitly flush the config... - Engine.ConfigDB_SetChanges("user", true); - Engine.ConfigDB_WriteFile("user", "config/user.cfg"); + Engine.ConfigDB_ConfigDB_CreateAndSaveValue("user", "gui.session.defaultformation", this.defaultFormation); return true; } diff --git a/binaries/data/mods/public/gui/session/RangeOverlayManager.js b/binaries/data/mods/public/gui/session/RangeOverlayManager.js index 9097202c7b..c1218d0ffb 100644 --- a/binaries/data/mods/public/gui/session/RangeOverlayManager.js +++ b/binaries/data/mods/public/gui/session/RangeOverlayManager.js @@ -51,11 +51,10 @@ class RangeOverlayManager { let enabled = !this.isEnabled(type); - Engine.ConfigDB_CreateAndWriteValueToFile( + Engine.ConfigDB_CreateAndSaveValue( "user", type.config, - String(enabled), - "config/user.cfg"); + String(enabled)); this.setEnabled(type, enabled); } diff --git a/binaries/data/mods/public/gui/session/chat/ChatWindow.js b/binaries/data/mods/public/gui/session/chat/ChatWindow.js index 4ed6786d7e..b05a9283c0 100644 --- a/binaries/data/mods/public/gui/session/chat/ChatWindow.js +++ b/binaries/data/mods/public/gui/session/chat/ChatWindow.js @@ -28,7 +28,7 @@ class ChatWindow this.closeChat.onPress = this.closePage.bind(this); this.extendedChat.onPress = () => { - Engine.ConfigDB_CreateAndWriteValueToFile("user", "chat.session.extended", String(this.isExtended()), "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "chat.session.extended", String(this.isExtended())); this.resizeChatWindow(); this.chatInput.focus(); }; diff --git a/binaries/data/mods/public/gui/session/session.js b/binaries/data/mods/public/gui/session/session.js index 5f840a4f38..f565ad0838 100644 --- a/binaries/data/mods/public/gui/session/session.js +++ b/binaries/data/mods/public/gui/session/session.js @@ -832,7 +832,7 @@ function updateDisplayedNames() function toggleConfigBool(configName) { let enabled = Engine.ConfigDB_GetValue("user", configName) != "true"; - Engine.ConfigDB_CreateAndWriteValueToFile("user", configName, String(enabled), "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", configName, String(enabled)); return enabled; } diff --git a/binaries/data/mods/public/gui/session/top_panel/CounterManager.js b/binaries/data/mods/public/gui/session/top_panel/CounterManager.js index 5b3dfcaa21..6f83f921b6 100644 --- a/binaries/data/mods/public/gui/session/top_panel/CounterManager.js +++ b/binaries/data/mods/public/gui/session/top_panel/CounterManager.js @@ -55,11 +55,10 @@ class CounterManager onPress() { - Engine.ConfigDB_CreateAndWriteValueToFile( + Engine.ConfigDB_CreateAndSaveValue( "user", "gui.session.respoptooltipsort", - String((+Engine.ConfigDB_GetValue("user", "gui.session.respoptooltipsort") + 2) % 3 - 1), - "config/user.cfg"); + String((+Engine.ConfigDB_GetValue("user", "gui.session.respoptooltipsort") + 2) % 3 - 1)); this.rebuild(); } diff --git a/binaries/data/mods/public/gui/splashscreen/splashscreen.js b/binaries/data/mods/public/gui/splashscreen/splashscreen.js index b26f81b62c..3d8e8787dd 100644 --- a/binaries/data/mods/public/gui/splashscreen/splashscreen.js +++ b/binaries/data/mods/public/gui/splashscreen/splashscreen.js @@ -8,7 +8,7 @@ function init(data) function closePage() { - Engine.ConfigDB_CreateAndWriteValueToFile("user", "gui.splashscreen.enable", String(Engine.GetGUIObjectByName("displaySplashScreen").checked), "config/user.cfg"); - Engine.ConfigDB_CreateAndWriteValueToFile("user", "gui.splashscreen.version", Engine.GetFileMTime(g_SplashScreenFile), "config/user.cfg"); + Engine.ConfigDB_CreateAndSaveValue("user", "gui.splashscreen.enable", String(Engine.GetGUIObjectByName("displaySplashScreen").checked)); + Engine.ConfigDB_CreateAndSaveValue("user", "gui.splashscreen.version", Engine.GetFileMTime(g_SplashScreenFile)); Engine.PopGuiPage(); } diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp index 834347fe29..5349860185 100644 --- a/source/ps/ConfigDB.cpp +++ b/source/ps/ConfigDB.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -264,17 +264,18 @@ void CConfigDB::SetValueList(EConfigNamespace ns, const CStr& name, std::vector< it->second = values; } -void CConfigDB::RemoveValue(EConfigNamespace ns, const CStr& name) +bool CConfigDB::RemoveValue(EConfigNamespace ns, const CStr& name) { - CHECK_NS(;); + CHECK_NS(false); std::lock_guard s(m_Mutex); TConfigMap::iterator it = m_Map[ns].find(name); if (it == m_Map[ns].end()) - return; + return false; m_Map[ns].erase(it); TriggerAllHooks(m_Hooks, name); + return true; } void CConfigDB::SetConfigFile(EConfigNamespace ns, const VfsPath& path) diff --git a/source/ps/ConfigDB.h b/source/ps/ConfigDB.h index 55d643d595..c53d70c2b0 100644 --- a/source/ps/ConfigDB.h +++ b/source/ps/ConfigDB.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -134,7 +134,7 @@ public: /** * Remove a config value in the specified namespace. */ - void RemoveValue(EConfigNamespace ns, const CStr& name); + bool RemoveValue(EConfigNamespace ns, const CStr& name); /** * Set the path to the config file used to populate the specified namespace diff --git a/source/ps/scripting/JSInterface_ConfigDB.cpp b/source/ps/scripting/JSInterface_ConfigDB.cpp index c7d6d1562b..6c67142fa4 100644 --- a/source/ps/scripting/JSInterface_ConfigDB.cpp +++ b/source/ps/scripting/JSInterface_ConfigDB.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -113,6 +113,7 @@ bool CreateValue(const std::wstring& cfgNsString, const std::string& name, const return false; g_ConfigDB.SetValueString(cfgNs, name, value); + g_ConfigDB.SetChanges(cfgNs, true); return true; } @@ -126,6 +127,7 @@ bool CreateValues(const std::wstring& cfgNsString, const std::string& name, cons return false; g_ConfigDB.SetValueList(cfgNs, name, values); + g_ConfigDB.SetChanges(cfgNs, true); return true; } @@ -139,20 +141,36 @@ bool RemoveValue(const std::wstring& cfgNsString, const std::string& name) if (!GetConfigNamespace(cfgNsString, cfgNs)) return false; - g_ConfigDB.RemoveValue(cfgNs, name); - return true; + bool result = g_ConfigDB.RemoveValue(cfgNs, name); + if (result) + g_ConfigDB.SetChanges(cfgNs, true); + + return result; } -bool WriteFile(const std::wstring& cfgNsString, const Path& path) +bool SaveChanges(const std::wstring& cfgNsString) { EConfigNamespace cfgNs; if (!GetConfigNamespace(cfgNsString, cfgNs)) return false; - return g_ConfigDB.WriteFile(cfgNs, path); + bool result = g_ConfigDB.WriteFile(cfgNs); + if (result) + g_ConfigDB.SetChanges(cfgNs, false); + + return result; } -bool WriteValueToFile(const std::wstring& cfgNsString, const std::string& name, const std::string& value, const Path& path) +bool RemoveValueAndSave(const std::wstring& cfgNsString, const std::string& name) +{ + if (RemoveValue(cfgNsString, name)) + return SaveChanges(cfgNsString); + + return false; +} + + +bool SaveValue(const std::wstring& cfgNsString, const std::string& name, const std::string& value) { if (IsProtectedConfigName(name)) return false; @@ -161,13 +179,13 @@ bool WriteValueToFile(const std::wstring& cfgNsString, const std::string& name, if (!GetConfigNamespace(cfgNsString, cfgNs)) return false; - return g_ConfigDB.WriteValueToFile(cfgNs, name, value, path); + return g_ConfigDB.WriteValueToFile(cfgNs, name, value); } -void CreateAndWriteValueToFile(const std::wstring& cfgNsString, const std::string& name, const std::string& value, const Path& path) +void CreateAndSaveValue(const std::wstring& cfgNsString, const std::string& name, const std::string& value) { - CreateValue(cfgNsString, name, value); - WriteValueToFile(cfgNsString, name, value, path); + if (CreateValue(cfgNsString, name, value)) + SaveValue(cfgNsString, name, value); } bool Reload(const std::wstring& cfgNsString) @@ -179,16 +197,6 @@ bool Reload(const std::wstring& cfgNsString) return g_ConfigDB.Reload(cfgNs); } -bool SetFile(const std::wstring& cfgNsString, const Path& path) -{ - EConfigNamespace cfgNs; - if (!GetConfigNamespace(cfgNsString, cfgNs)) - return false; - - g_ConfigDB.SetConfigFile(cfgNs, path); - return true; -} - void PauseOnFocusLoss(bool pause) { g_PauseOnFocusLoss = pause; @@ -207,10 +215,10 @@ void RegisterScriptFunctions(const ScriptRequest& rq) ScriptFunction::Register<&CreateValue>(rq, "ConfigDB_CreateValue"); ScriptFunction::Register<&CreateValues>(rq, "ConfigDB_CreateValues"); ScriptFunction::Register<&RemoveValue>(rq, "ConfigDB_RemoveValue"); - ScriptFunction::Register<&WriteFile>(rq, "ConfigDB_WriteFile"); - ScriptFunction::Register<&WriteValueToFile>(rq, "ConfigDB_WriteValueToFile"); - ScriptFunction::Register<&CreateAndWriteValueToFile>(rq, "ConfigDB_CreateAndWriteValueToFile"); - ScriptFunction::Register<&SetFile>(rq, "ConfigDB_SetFile"); + ScriptFunction::Register<&RemoveValueAndSave>(rq, "ConfigDB_RemoveValueAndSave"); + ScriptFunction::Register<&SaveChanges>(rq, "ConfigDB_SaveChanges"); + ScriptFunction::Register<&SaveValue>(rq, "ConfigDB_SaveValue"); + ScriptFunction::Register<&CreateAndSaveValue>(rq, "ConfigDB_CreateAndSaveValue"); ScriptFunction::Register<&Reload>(rq, "ConfigDB_Reload"); ScriptFunction::Register<&PauseOnFocusLoss>(rq, "PauseOnFocusLoss"); ScriptFunction::Register<&SetGUIScale>(rq, "SetGUIScale");