8b1be3a - More auras and stagger tracking
[wowui.git] / kehys / updater.lua
index 68015bb..42aedf0 100644 (file)
@@ -23,6 +23,8 @@ local healcolor = addon.Colors.OverlayColorHeal;
 
 local ignoredAuras = {
     [315176] = true, -- Grasping Tendrils
+    [313759] = true, -- Cursed Blood (Il'gynoth)
+    [312486] = true, -- Recurring Nightmare (Il'gynoth)
 };
 
 local powerColors = {
@@ -46,8 +48,8 @@ function addon.FrameUpdate(frame)
     -- range check (doesn't have an event) frames can be marked constantly visible
     if not frame.constant then
         local inrange, checked = UnitInRange(unit);
-        local inphase = UnitInPhase(unit);
-        if (checked and not inrange) or not inphase then
+        local inphase = UnitPhaseReason(unit);
+        if (checked and not inrange) or inphase then
             frame:SetAlpha(0.55);
         else
             frame:SetAlpha(1);
@@ -140,6 +142,8 @@ function addon.FrameUpdate(frame)
                     frame.text:SetFormattedText("%.2fM", current / 1000000);
                 elseif current > 1000 then -- 1.0K
                     frame.text:SetFormattedText("%.1fK", current / 1000);
+                else
+                    frame.text:SetFormattedText("%i", current);
                 end
                 if not frame.text:IsShown() then frame.text:Show() end
             end
@@ -225,6 +229,8 @@ function addon.FrameUpdate(frame)
                 frame.stacks = {};
                 frame.heal = {};
                 frame.buff1 = {};
+                frame.buff2 = {};
+                frame.stagger = {};
                 addon.SetAuras(frame.unit, frame.guid);
                 frame.rounds = 0;
             end
@@ -241,6 +247,10 @@ function addon.FrameUpdate(frame)
                 local _, amount = next(frame.stacks);
                 frame.stack:SetText(amount);
                 if not frame.stack:IsShown() then frame.stack:Show() end
+            elseif next(frame.hits) then
+                local _, amount = next(frame.hits);
+                frame.stack:SetText(amount);
+                if not frame.stack:IsShown() then frame.stack:Show() end
             elseif frame.stack:IsShown() then
                 frame.stack:Hide();
             end
@@ -262,6 +272,25 @@ function addon.FrameUpdate(frame)
             elseif frame.glow:IsShown() then
                 frame.glow:Hide();
             end
+            -- DK Death Strike and Monk Stagger tracking
+            if frame.rolename == "TANK" then
+                if frame.classname == "DEATHKNIGHT" then
+                    local power = UnitPower(unit);
+                    if power < 45 then
+                        if not frame.bottomwarn:IsShown() then frame.bottomwarn:Show() end
+                    elseif frame.bottomwarn:IsShown() then
+                        frame.bottomwarn:Hide();
+                    end
+                elseif frame.classname == "MONK" then
+                    if next(frame.stagger) then -- Heavy Stagger
+                        if not frame.bottomwarn:IsShown() then frame.bottomwarn:Show() end
+                    elseif frame.bottomwarn:IsShown() then
+                        frame.bottomwarn:Hide();
+                    end
+                end
+            elseif frame.bottomwarn:IsShown() then
+                frame.bottomwarn:Hide();
+            end
             -- overlays
             if next(frame.alert) then
                 -- major