From 3f0366d356d49ec904023e68fae0ce2488bdfbc0 Mon Sep 17 00:00:00 2001 From: Aleksi Blinnikka Date: Mon, 11 Feb 2019 21:53:17 +0200 Subject: [PATCH 1/1] Add a secondary alert color, high healing needed --- kehys/auras.lua | 19 ++++++++++++++----- kehys/frame.lua | 1 + kehys/setup.lua | 1 + kehys/updater.lua | 10 +++++++++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/kehys/auras.lua b/kehys/auras.lua index 3e29a31..ecefd00 100644 --- a/kehys/auras.lua +++ b/kehys/auras.lua @@ -18,22 +18,31 @@ local watchedAuras = { --[258323] = {bar=false}, -- Infected Wound --[262513] = {bar=false}, -- Azerite Heartseeker -- Uldir - [265264] = 2, -- Void Lash (Zek'voz) + [265264] = {2, "alert"}, -- Void Lash (Zek'voz) -- Battle of Dazar'alor - [285213] = 1, -- Caress of Death (Rastakhan) + [285213] = {1, "alert"}, -- Caress of Death (Rastakhan) + [285195] = {12, "heal"}, -- Deathly Withering (Rastakhan) }; local auraEvents = {}; auraEvents.SPELL_AURA_APPLIED = function(frame, id, _, _, _, amount) - if amount == nil or amount >= watchedAuras[id] then - frame.alert[id] = true; + if (amount == nil and watchedAuras[id][1] == 1) or (amount ~= nil and amount >= watchedAuras[id][1]) then + if watchedAuras[id][2] == "alert" then + frame.alert[id] = true; + else + frame.heal[id] = true; + end end end auraEvents.SPELL_AURA_APPLIED_DOSE = auraEvents.SPELL_AURA_APPLIED; auraEvents.SPELL_AURA_REFRESH = auraEvents.SPELL_AURA_APPLIED; auraEvents.SPELL_AURA_REMOVED = function(frame, id, _, _, _, amount) if amount == nil or amount == 0 then - frame.alert[id] = nil; + if watchedAuras[id][2] == "alert" then + frame.alert[id] = nil; + else + frame.heal[id] = nil; + end end end auraEvents.SPELL_AURA_REMOVED_DOSE = auraEvents.SPELL_AURA_REMOVED; diff --git a/kehys/frame.lua b/kehys/frame.lua index 535899c..252b971 100644 --- a/kehys/frame.lua +++ b/kehys/frame.lua @@ -50,6 +50,7 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f.vehicle = unit == "player" and "vehicle" or format("%spet", unit); f.prev = {} -- values stored from previous update f.alert = {}; -- alerting auras + f.heal = {}; -- high healing auras -- set up periodic updates updaters[f] = function() if f.updating then diff --git a/kehys/setup.lua b/kehys/setup.lua index fbfb3d3..79ca970 100644 --- a/kehys/setup.lua +++ b/kehys/setup.lua @@ -19,6 +19,7 @@ addon.Colors = { OverlayColorDispel = {1, 0.5, 0, 0.5}, OverlayColorCharm = {0.8, 0, 1, 0.5}, OverlayColorAlert = {1, 0, 0, 0.5}, + OverlayColorHeal = {0, 1, 0.6, 0.5}, } addon.FrameGuids = {}; diff --git a/kehys/updater.lua b/kehys/updater.lua index f881ff7..f51d200 100644 --- a/kehys/updater.lua +++ b/kehys/updater.lua @@ -15,6 +15,7 @@ local UnitGetTotalHealAbsorbs = UnitGetTotalHealAbsorbs; local dispelcolor = addon.Colors.OverlayColorDispel; local charmcolor = addon.Colors.OverlayColorCharm; local majorcolor = addon.Colors.OverlayColorAlert; +local healcolor = addon.Colors.OverlayColorHeal; local function updateAuras() -- TODO @@ -126,13 +127,20 @@ function addon.FrameUpdate(frame) frame.healpred:Hide(); end -- auras - if frame.alert and next(frame.alert) then + if next(frame.alert) then -- major if frame.overlay.color ~= majorcolor then frame.overlay:SetVertexColor(unpack(majorcolor)); frame.overlay.color = majorcolor; if not frame.overlay:IsShown() then frame.overlay:Show() end end + elseif next(frame.heal) then + -- major heals needed + if frame.overlay.color ~= healcolor then + frame.overlay:SetVertexColor(unpack(healcolor)); + frame.overlay.color = healcolor; + if not frame.overlay:IsShown() then frame.overlay:Show() end + end elseif UnitIsCharmed(unit) and frame.unit == frame.displayed then -- charmed if frame.overlay.color ~= charmcolor then -- 2.39.5