From 7b731540c126d7e255fa3546692be8a933e3d500 Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Mon, 20 Oct 2025 11:06:04 -0700 Subject: [PATCH] absorb tracking --- WeakAuras/Prototypes.lua | 61 ++++++++++++++++++++++++++++++++++++++++ WeakAuras/Types.lua | 5 ++++ 2 files changed, 66 insertions(+) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 29700ab..f51cd63 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -2276,6 +2276,12 @@ Private.event_prototypes = { if trigger.use_ignoreDead or trigger.use_ignoreDisconnected then AddUnitEventForEvents(result, unit, "UNIT_FLAGS") end + if trigger.use_showAbsorb then + AddUnitEventForEvents(result, unit, "UNIT_ABSORB_AMOUNT_CHANGED") + end + if trigger.use_showHealAbsorb then + AddUnitEventForEvents(result, unit, "UNIT_HEAL_ABSORB_AMOUNT_CHANGED") + end if trigger.use_inRange then AddUnitEventForEvents(result, unit, "UNIT_IN_RANGE_UPDATE") end @@ -2398,6 +2404,31 @@ Private.event_prototypes = { }, formatter = "BigNumber", }, + { + name = "showAbsorb", + display = L["Show Absorb"], + type = "toggle", + test = "true", + reloadOptions = true + }, + { + name = "absorbMode", + display = L["Absorb Display"], + type = "select", + test = "true", + values = "absorb_modes", + required = true, + enable = function(trigger) return trigger.use_showAbsorb end + }, + { + name = "absorb", + type = "number", + display = L["Absorb"], + init = "UnitGetTotalAbsorbs(unit)", + store = true, + conditionType = "number", + enable = function(trigger) return trigger.use_showAbsorb end + }, { type = "header", name = "unitCharacteristicsHeader", @@ -2598,6 +2629,36 @@ Private.event_prototypes = { test = "WeakAuras.UnitExistsFixed(unit, smart) and specificUnitCheck" } }, + overlayFuncs = { + { + name = L["Absorb"], + func = function(trigger, state) + local absorb = state.absorb + if (trigger.absorbMode == "OVERLAY_FROM_START") then + return 0, absorb; + else + return "forward", absorb; + end + end, + enable = function(trigger) + return trigger.use_showAbsorb; + end + }, + { + name = L["Heal Absorb"], + func = function(trigger, state) + local healabsorb = state.healabsorb + if (trigger.absorbHealMode == "OVERLAY_FROM_START") then + return 0, healabsorb; + else + return "forward", healabsorb; + end + end, + enable = function(trigger) + return trigger.use_showHealAbsorb; + end + }, + }, automaticrequired = true }, ["Power"] = { diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 3eff4be..025cc07 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -3115,6 +3115,11 @@ Private.bool_types = { [1] = L["True"] } +Private.absorb_modes = { + OVERLAY_FROM_START = L["Attach to Start"], + OVERLAY_FROM_END = L["Attach to End"] +} + Private.update_categories = { { name = "anchor",