Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/session.js
Show First 20 Lines • Show All 791 Lines • ▼ Show 20 Lines | function onSimulationUpdate() | ||||
handleNotifications(); | handleNotifications(); | ||||
updateGUIObjects(); | updateGUIObjects(); | ||||
Engine.GuiInterfaceCall("EnableVisualRangeOverlayType", { | Engine.GuiInterfaceCall("EnableVisualRangeOverlayType", { | ||||
"type": "Aura", | "type": "Aura", | ||||
"enabled": Engine.ConfigDB_GetValue("user", "gui.session.aurarange") == "true" | "enabled": Engine.ConfigDB_GetValue("user", "gui.session.aurarange") == "true" | ||||
}); | }); | ||||
Engine.GuiInterfaceCall("EnableVisualRangeOverlayType", { | |||||
"type": "Heal", | |||||
"enabled": Engine.ConfigDB_GetValue("user", "gui.session.healrange") == "true" | |||||
}); | |||||
if (g_ConfirmExit) | if (g_ConfirmExit) | ||||
confirmExit(); | confirmExit(); | ||||
} | } | ||||
/** | /** | ||||
* Don't show the message box before all playerstate changes are processed. | * Don't show the message box before all playerstate changes are processed. | ||||
*/ | */ | ||||
function confirmExit() | function confirmExit() | ||||
▲ Show 20 Lines • Show All 446 Lines • ▼ Show 20 Lines | Engine.GuiInterfaceCall("SetStatusBars", { | ||||
"enabled": g_ShowAllStatusBars && !remove | "enabled": g_ShowAllStatusBars && !remove | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Toggles the display of range overlays of selected entities for the given range type. | * Toggles the display of range overlays of selected entities for the given range type. | ||||
* @param {string} type - for example "Aura" | * @param {string} type - for example "Aura" | ||||
*/ | */ | ||||
function toggleRangeOverlay(type, currentValue) | function toggleRangeOverlay(type) | ||||
{ | { | ||||
let configString = "gui.session." + type.toLowerCase() + "range"; | let configString = "gui.session." + type.toLowerCase() + "range"; | ||||
let enabled = Engine.ConfigDB_GetValue("user", configString) != "true"; | let enabled = Engine.ConfigDB_GetValue("user", configString) != "true"; | ||||
Engine.ConfigDB_CreateValue("user", configString, String(enabled)); | Engine.ConfigDB_CreateValue("user", configString, String(enabled)); | ||||
Engine.ConfigDB_WriteValueToFile("user", configString, String(enabled), "config/user.cfg"); | Engine.ConfigDB_WriteValueToFile("user", configString, String(enabled), "config/user.cfg"); | ||||
Engine.GuiInterfaceCall("EnableVisualRangeOverlayType", { | Engine.GuiInterfaceCall("EnableVisualRangeOverlayType", { | ||||
"type": type, | "type": type, | ||||
"enabled": enabled | "enabled": enabled | ||||
}); | }); | ||||
elexis: By the looks of things we just have to call these statements below when closing the options… | |||||
let selected = g_Selection.toList(); | let selected = g_Selection.toList(); | ||||
for (let ent in g_Selection.highlighted) | for (let ent in g_Selection.highlighted) | ||||
selected.push(g_Selection.highlighted[ent]); | selected.push(g_Selection.highlighted[ent]); | ||||
Engine.GuiInterfaceCall("SetRangeOverlays", { | Engine.GuiInterfaceCall("SetRangeOverlays", { | ||||
"entities": selected, | "entities": selected, | ||||
"enabled": enabled | "enabled": enabled | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 353 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
By the looks of things we just have to call these statements below when closing the options page to make that one actually work.