156861c - Non-raid unit frame fixes
[wowui.git] / kehys / updater.lua
index 9a673ae..3690953 100644 (file)
@@ -27,9 +27,14 @@ local ignoredAuras = {
 local powerColors = {
     [Enum.PowerType.Mana] = {0.1, 0.5, 0.9},
     [Enum.PowerType.Rage] = {1, 0, 0},
+    [Enum.PowerType.Pain] = {1, 0, 0},
     [Enum.PowerType.Focus] = {1, 0.5, 0},
     [Enum.PowerType.Energy] = {1, 0.8, 0},
+    [Enum.PowerType.Fury] = {0.8, 0.3, 0.9},
     [Enum.PowerType.RunicPower] = {0.8, 0, 0.2},
+    [Enum.PowerType.LunarPower] = {0.3, 0.5, 0.9},
+    [Enum.PowerType.Maelstrom] = {0, 0.5, 1},
+    [Enum.PowerType.Insanity] = {0.4, 0, 0.8},
 };
 
 function addon.FrameUpdate(frame)
@@ -78,11 +83,11 @@ function addon.FrameUpdate(frame)
             if not frame.text:IsShown() then frame.text:Show() end
         else
             frame.text.status = false;
-            if not (frame.nonraid and frame.unit == "target") and frame.text:IsShown() then
+            if (frame.raid or frame.unit ~= "target") and frame.text:IsShown() then
                 frame.text:Hide();
             end
         end
-        if frame.nonraid and frame.unit == "player" then
+        if not frame.raid and frame.unit == "player" then
             if InCombatLockdown() then
                 frame.status:SetTexCoord(0.5, 1, 0, 0.484375);
                 frame.status:Show();
@@ -93,11 +98,11 @@ function addon.FrameUpdate(frame)
                 frame.status:Hide();
             end
         end
-        -- TODO incoming res, maybe just with events?
         -- health
         local current, hmax = UnitHealth(unit), UnitHealthMax(unit);
         if frame.prev.health ~= current or frame.prev.hmax ~= hmax then
-            if frame.nonraid and frame.unit == "target" and frame.prev.htext ~= current then
+            if not frame.raid and frame.unit == "target" and not frame.text.status
+               and frame.prev.htext ~= current then
                 frame.prev.htext = current;
                 if current > 1000000000 then -- 1.0B
                     frame.text:SetFormattedText("%.2fB", current / 1000000000);
@@ -205,7 +210,7 @@ function addon.FrameUpdate(frame)
                 frame.rounds = 0;
             end
         end
-        if not frame.nonraid then
+        if frame.raid then
             -- tank CD marker
             if next(frame.tankcd) then
                 if not frame.defensive:IsShown() then frame.defensive:Show() end