c39801d - Add simple red alert aura tracking
[wowui.git] / OmaRF / Events.lua
index 94dd14f..2ffe946 100644 (file)
@@ -20,7 +20,8 @@ local READY_CHECK_READY_TEXTURE = READY_CHECK_READY_TEXTURE;
 local READY_CHECK_NOT_READY_TEXTURE = READY_CHECK_NOT_READY_TEXTURE;
 local READY_CHECK_WAITING_TEXTURE = READY_CHECK_WAITING_TEXTURE;
 
-local checkIndicators = OmaRFIndicators.CheckIndicators;
+local updateIndicatorAuras = OmaRFIndicators.UpdateAuras;
+local updateMajorAuras = OmaRFIndicators.UpdateMajorAuras;
 
 local Settings = OmaRFSettings;
 local baseColor = Settings.BaseColor;
@@ -98,7 +99,7 @@ local function updateHealth(frame, unit)
         frame.health:Show();
     elseif current <= 0 or UnitIsDeadOrGhost(unit) then
         frame.health:Hide();
-        updateText(frame, unit); -- update death
+        return updateText(frame, unit); -- update death
     else
         local w = current/max*width;
         frame.health:SetWidth(w);
@@ -179,12 +180,17 @@ end
 M.UpdateHealAbsorb = updateHealAbsorb;
 
 local function updateAuras(frame, unit)
-    local alert = checkIndicators(frame, unit);
-    if alert then
-        if frame.overlay.color ~= overlayColorAlert then
+    updateIndicatorAuras(frame, unit); -- this is throttled
+    local barColor = updateMajorAuras(frame, unit);
+    if barColor then
+        if barColor == true and frame.overlay.color ~= overlayColorAlert then
             frame.overlay:SetVertexColor(unpack(overlayColorAlert));
             frame.overlay.color = overlayColorAlert;
             frame.overlay:Show();
+        elseif barColor ~= true and frame.overlay.color ~= barColor then
+            frame.overlay:SetVertexColor(unpack(barColor));
+            frame.overlay.color = barColor;
+            frame.overlay:Show();
         end
     elseif UnitDebuff(unit, 1, "RAID") ~= nil then
         -- something dispellable
@@ -349,5 +355,5 @@ eventFuncs["PLAYER_ENTERING_WORLD"] = eventFuncs["UPDATE_ALL_BARS"];
 eventFuncs["PLAYER_FOCUS_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
 
 function M.UnitEvent(self, event)
-    eventFuncs[event](self);
+    return eventFuncs[event](self);
 end