e90f2ac - Only go through auras once
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Mon, 26 Mar 2018 10:04:24 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Mon, 26 Mar 2018 10:04:24 +0000
OmaAB/ActionBars.lua
OmaRF/Events.lua
OmaUF/Auras.lua
OmaUF/Events.lua

index 10cd415..02bdcb9 100644 (file)
@@ -663,7 +663,6 @@ local events = {
         end
     end,
     ["PLAYER_LOGIN"] = function()
-        GameTooltip = _G["GameTooltip"];
         initialize();
     end,
     ["ADDON_LOADED"] = function(addon)
index 94dd14f..762cb99 100644 (file)
@@ -98,7 +98,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);
@@ -349,5 +349,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
index 0341a4d..172e3d4 100644 (file)
@@ -78,10 +78,6 @@ end
 
 function M.UpdateAuras(frame, unit)
     local auras = frame.auras;
-    for _, aura in ipairs(auras) do
-        if not aura:IsShown() then break end
-        aura:Hide();
-    end
     local icon, count, duration, expires, caster, id;
     local pos = 1;
     for _, filter in ipairs(auraFilters) do
@@ -110,4 +106,10 @@ function M.UpdateAuras(frame, unit)
             i = i + 1;
         end
     end
+
+    while auras[pos] do
+        if not auras[pos]:IsShown() then return end
+        auras[pos]:Hide();
+        pos = pos + 1;
+    end
 end
index 9a06947..28b8672 100644 (file)
@@ -438,5 +438,5 @@ eventFuncs["INSTANCE_ENCOUNTER_ENGAGE_UNIT"] = eventFuncs["UPDATE_ALL_BARS"];
 eventFuncs["UNIT_TARGETABLE_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
 
 function M.UnitEvent(self, event, arg1)
-    eventFuncs[event](self, arg1);
+    return eventFuncs[event](self, arg1);
 end