Index: binaries/data/config/default.cfg =================================================================== --- binaries/data/config/default.cfg +++ binaries/data/config/default.cfg @@ -164,7 +164,8 @@ session.showstatusbars = Tab ; Toggle display of status bars session.highlightguarding = PgDn ; Toggle highlight of guarding units session.highlightguarded = PgUp ; Toggle highlight of guarded units -session.toggleaurarange = "Alt+V" ; Toggle rendering of aura range overlays of selected units and structures +session.toggleaurarange = "Alt+V" ; Toggle display of aura range overlays of selected units and structures +session.togglehealrange = "Alt+B" ; Toggle display of heal range overlays of selected units ; > HOTKEYS ONLY chat = Return ; Toggle chat window @@ -337,7 +338,8 @@ camerajump.threshold = 40 ; How close do we have to be to the actual location in order to jump back to the previous one? timeelapsedcounter = false ; Show the game duration in the top right corner batchtrainingsize = 5 ; Number of units to be trained per batch (when pressing the hotkey) -aurarange = true +aurarange = true ; Display aura range overlays of selected units and structures +healrange = true ; Display heal range overlays of selected units [gui.session.minimap] blinkduration = 1.7 ; The blink duration while pinging Index: binaries/data/mods/public/gui/manual/intro.txt =================================================================== --- binaries/data/mods/public/gui/manual/intro.txt +++ binaries/data/mods/public/gui/manual/intro.txt @@ -109,6 +109,7 @@ Alt + S: Toggle unit silhouettes (might give a small performance boost) Alt + Z: Toggle sky Alt + V: Toggle aura range visualizations of selected units and structures +Alt + B: Toggle heal range visualizations of selected units [font="sans-bold-14"]Camera manipulation [font="sans-14"]W or \[up]: Pan screen up Index: binaries/data/mods/public/gui/options/options.json =================================================================== --- binaries/data/mods/public/gui/options/options.json +++ binaries/data/mods/public/gui/options/options.json @@ -102,6 +102,18 @@ "label": "Chat Timestamp", "tooltip": "Show time that messages are posted in the lobby, gamesetup and ingame chat.", "parameters": { "config": "chat.timestamp" } + }, + { + "type": "boolean", + "label": "Aura Range Visualization", + "tooltip": "Display the range of auras of selected units and structures (can also be toggled in-game with the hotkey).", + "parameters": { "config": "gui.session.aurarange" } + }, + { + "type": "boolean", + "label": "Heal Range Visualization", + "tooltip": "Display the healing range of selected units (can also be toggled in-game with the hotkey).", + "parameters": { "config": "gui.session.healrange" } } ], "graphicsSetting": @@ -215,12 +227,6 @@ "label": "FPS throttling in games", "tooltip": "To save CPU workload, throttle render frequency in running games. Set to maximum to disable throttling.", "parameters": { "config": "adaptivefps.session", "min": 20, "max": 100 } - }, - { - "type": "boolean", - "label": "Aura Range Visualization", - "tooltip": "Display the range of auras of selected units and structures (can also be toggled in-game with the hotkey).", - "parameters": { "config": "gui.session.aurarange" } } ], "soundSetting": Index: binaries/data/mods/public/gui/session/hotkeys/misc.xml =================================================================== --- binaries/data/mods/public/gui/session/hotkeys/misc.xml +++ binaries/data/mods/public/gui/session/hotkeys/misc.xml @@ -96,4 +96,7 @@ toggleRangeOverlay("Aura"); + + toggleRangeOverlay("Heal"); + Index: binaries/data/mods/public/gui/session/session.js =================================================================== --- binaries/data/mods/public/gui/session/session.js +++ binaries/data/mods/public/gui/session/session.js @@ -797,6 +797,11 @@ "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) confirmExit(); } @@ -1260,7 +1265,7 @@ * Toggles the display of range overlays of selected entities for the given range type. * @param {string} type - for example "Aura" */ -function toggleRangeOverlay(type, currentValue) +function toggleRangeOverlay(type) { let configString = "gui.session." + type.toLowerCase() + "range"; let enabled = Engine.ConfigDB_GetValue("user", configString) != "true"; Index: binaries/data/mods/public/simulation/components/GuiInterface.js =================================================================== --- binaries/data/mods/public/simulation/components/GuiInterface.js +++ binaries/data/mods/public/simulation/components/GuiInterface.js @@ -948,7 +948,7 @@ { let cmpRangeVisualization = Engine.QueryInterface(ent, IID_RangeVisualization); if (cmpRangeVisualization) - cmpRangeVisualization.SetEnabled(cmd.enabled, this.enabledVisualRangeOverlayTypes); + cmpRangeVisualization.SetEnabled(cmd.enabled, this.enabledVisualRangeOverlayTypes, true); } }; Index: binaries/data/mods/public/simulation/components/Heal.js =================================================================== --- binaries/data/mods/public/simulation/components/Heal.js +++ binaries/data/mods/public/simulation/components/Heal.js @@ -4,6 +4,11 @@ "Controls the healing abilities of the unit." + "" + "20" + + "" + + "outline_border.png" + + "outline_border_mask.png" + + "0.2" + + "" + "5" + "2000" + "Cavalry" + @@ -12,6 +17,15 @@ "" + "" + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + "" + "" + "" + @@ -73,6 +87,21 @@ return this.template.HealableClasses._string || ""; }; +Heal.prototype.GetLineTexture = function() +{ + return this.template.RangeOverlay ? this.template.RangeOverlay.LineTexture : "outline_border.png"; +}; + +Heal.prototype.GetLineTextureMask = function() +{ + return this.template.RangeOverlay ? this.template.RangeOverlay.LineTextureMask : "outline_border_mask.png"; +}; + +Heal.prototype.GetLineThickness = function() +{ + return this.template.RangeOverlay ? +this.template.RangeOverlay.LineThickness : 0.15; +}; + /** * Heal the target entity. This should only be called after a successful range * check, and should only be called after GetTimers().repeat msec has passed Index: binaries/data/mods/public/simulation/components/RangeVisualization.js =================================================================== --- binaries/data/mods/public/simulation/components/RangeVisualization.js +++ binaries/data/mods/public/simulation/components/RangeVisualization.js @@ -6,10 +6,12 @@ { this.enabled = false; this.enabledRangeTypes = { - "Aura": false + "Aura": false, + "Heal": false }; this.rangeVisualizations = new Map(); + this.configChange = false; for (let type in this.enabledRangeTypes) this["GetVisual" + type + "Ranges"](type); }; @@ -37,12 +39,27 @@ "textureMask": cmpAuras.GetLineTextureMask(auraName), "thickness": cmpAuras.GetLineThickness(auraName), }); +}; + +RangeVisualization.prototype.GetVisualHealRanges = function(type) +{ + let cmpHeal = Engine.QueryInterface(this.entity, IID_Heal); + if (!cmpHeal) + return; + + this.rangeVisualizations.set(type, [{ + "radius": cmpHeal.GetRange().max, + "texture": cmpHeal.GetLineTexture(), + "textureMask": cmpHeal.GetLineTextureMask(), + "thickness": cmpHeal.GetLineThickness(), + }]); }; -RangeVisualization.prototype.SetEnabled = function(enabled, enabledRangeTypes) +RangeVisualization.prototype.SetEnabled = function(enabled, enabledRangeTypes, configChange = false) { this.enabled = enabled; this.enabledRangeTypes = enabledRangeTypes; + this.configChange = configChange; this.RegenerateRangeVisualizations(); }; @@ -55,7 +72,7 @@ cmpSelectable.ResetRangeOverlays(); - if (!this.enabled) + if (!this.enabled && !this.configChange) return; // Only render individual range types that have been enabled @@ -67,12 +84,22 @@ rangeOverlay.texture, rangeOverlay.textureMask, rangeOverlay.thickness); + this.configChange = false; }; RangeVisualization.prototype.OnOwnershipChanged = function(msg) { if (this.enabled && msg.to != -1) this.RegenerateRangeVisualizations(); +}; + +RangeVisualization.prototype.OnValueModification = function(msg) +{ + if (msg.valueNames.indexOf("Heal/Range") == -1) + return; + + this["GetVisual" + msg.component + "Ranges"](msg.component); + this.RegenerateRangeVisualizations(); }; Engine.RegisterComponentType(IID_RangeVisualization, "RangeVisualization", RangeVisualization);