Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/binaries/data/mods/public/gui/gamesetup/gamesetup.js b/binaries/data/mods/public/gui/gamesetup/gamesetup.js
- index 90fad63..0af84cf 100644
- --- a/binaries/data/mods/public/gui/gamesetup/gamesetup.js
- +++ b/binaries/data/mods/public/gui/gamesetup/gamesetup.js
- @@ -206,6 +206,11 @@ var g_ServerPort;
- var g_IsInGuiUpdate;
- /**
- + * States whether the settings are currently initialized and therefore shouldn't update the GUI objects.
- + */
- +var g_IsSupplementingDefaults;
- +
- +/**
- * Whether the current player is ready to start the game.
- * 0 - not ready
- * 1 - ready
- @@ -850,6 +855,11 @@ function initDefaults()
- */
- function supplementDefaults()
- {
- + if (g_IsSupplementingDefaults)
- + return;
- +
- + g_IsSupplementingDefaults = true;
- +
- for (let dropdown in g_Dropdowns)
- if (!g_Dropdowns[dropdown].defined())
- g_Dropdowns[dropdown].select(g_Dropdowns[dropdown].default());
- @@ -862,6 +872,8 @@ function supplementDefaults()
- for (let i = 0; i < g_GameAttributes.settings.PlayerData.length; ++i)
- if (!isControlArrayElementHidden(i) && !g_DropdownArrays[dropdown].defined(i))
- g_DropdownArrays[dropdown].select(g_DropdownArrays[dropdown].default(i), i);
- +
- + g_IsSupplementingDefaults = false;
- }
- /**
- @@ -1494,6 +1506,9 @@ function isControlArrayElementHidden(idx)
- */
- function updateGUIDropdown(name, idx = undefined)
- {
- + if (g_IsSupplementingDefaults)
- + return;
- +
- let [guiName, guiIdx] = getGUIObjectNameFromSetting(name);
- let idxName = idx === undefined ? "": "[" + idx + "]";
- @@ -1532,6 +1547,9 @@ function updateGUIDropdown(name, idx = undefined)
- */
- function updateGUICheckbox(name)
- {
- + if (g_IsSupplementingDefaults)
- + return;
- +
- let obj = g_Checkboxes[name];
- let checked = obj.get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement