X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/fb13e34ef34a0d06235ca2b6dd3de0f5dbbd7fd8..9d2b39eafbaccdfcc3ea838f41e0af1a963b5ed6:/kehys/updater.lua diff --git a/kehys/updater.lua b/kehys/updater.lua index 668f229..bb8fba1 100644 --- a/kehys/updater.lua +++ b/kehys/updater.lua @@ -17,6 +17,11 @@ local charmcolor = addon.Colors.OverlayColorCharm; local majorcolor = addon.Colors.OverlayColorAlert; local healcolor = addon.Colors.OverlayColorHeal; +local ignoredAuras = { + [315176] = true, -- Grasping Tendrils +}; + +local rounds = 0; function addon.FrameUpdate(frame) assert(type(frame) == "table", "FrameUpdate received invalid frame parameter!"); @@ -119,6 +124,16 @@ function addon.FrameUpdate(frame) elseif frame.healpred:IsShown() then frame.healpred:Hide(); end + rounds = rounds + 1; + if (rounds > 8) then + frame.tankcd = {}; + frame.alert = {}; + frame.stacks = {}; + frame.heal = {}; + frame.buff1 = {}; + addon.SetAuras(frame.unit, frame.guid); + rounds = 0; + end -- tank CD marker if next(frame.tankcd) then if not frame.defensive:IsShown() then frame.defensive:Show() end @@ -127,11 +142,18 @@ function addon.FrameUpdate(frame) end -- aura stacks if next(frame.stacks) then - frame.stack:SetText(next(frame.stacks)); + local _, amount = next(frame.stacks); + frame.stack:SetText(amount); if not frame.stack:IsShown() then frame.stack:Show() end elseif frame.stack:IsShown() then frame.stack:Hide(); end + -- custom buff indicator 1 + if next(frame.buff1) then + if not frame.buffind1:IsShown() then frame.buffind1:Show() end + elseif frame.buffind1:IsShown() then + frame.buffind1:Hide(); + end -- overlays if next(frame.alert) then -- major @@ -140,31 +162,34 @@ function addon.FrameUpdate(frame) 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 - frame.overlay:SetVertexColor(unpack(charmcolor)); - frame.overlay.color = charmcolor; - if not frame.overlay:IsShown() then frame.overlay:Show() end - end - elseif UnitDebuff(unit, 1, "RAID") ~= nil then - -- dispellable - if frame.overlay.color ~= dispelcolor then - frame.overlay:SetVertexColor(unpack(dispelcolor)); - frame.overlay.color = dispelcolor; - if not frame.overlay:IsShown() then frame.overlay:Show() end - end else - if frame.overlay.color ~= nil then - frame.overlay.color = nil; - if frame.overlay:IsShown() then frame.overlay:Hide() end + local _, _, _, _, _, _, _, _, _, spellid = UnitDebuff(unit, 1, "RAID"); + if UnitIsCharmed(unit) and frame.unit == frame.displayed then + -- charmed + if frame.overlay.color ~= charmcolor then + frame.overlay:SetVertexColor(unpack(charmcolor)); + frame.overlay.color = charmcolor; + if not frame.overlay:IsShown() then frame.overlay:Show() end + end + elseif spellid ~= nil and not ignoredAuras[spellid] then + -- dispellable + if frame.overlay.color ~= dispelcolor then + frame.overlay:SetVertexColor(unpack(dispelcolor)); + frame.overlay.color = dispelcolor; + 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 + else + if frame.overlay.color ~= nil then + frame.overlay.color = nil; + if frame.overlay:IsShown() then frame.overlay:Hide() end + end end end end