fb13e34 - Add 2 new aura types
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Fri, 1 Mar 2019 16:11:35 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Fri, 1 Mar 2019 16:11:35 +0000
Tankcd shows externals in topleft corner.
Stacks shows stacking debuffs in bottomleft corner.

kehys/auras.lua
kehys/frame.lua
kehys/updater.lua

index ecefd00..40f7446 100644 (file)
@@ -17,32 +17,35 @@ local watchedAuras = {
     --[266209] = {bar=false}, -- Wicked Frenzy
     --[258323] = {bar=false}, -- Infected Wound
     --[262513] = {bar=false}, -- Azerite Heartseeker
+    -- Tank defensives
+    [6940] = {1, "tankcd"}, -- Blessing of Sacrifice
+    [33206] = {1, "tankcd"}, -- Pain Suppression
+    [47788] = {1, "tankcd"}, -- Guardian Spirit
+    [102342] = {1, "tankcd"}, -- Ironbark
+    [116849] = {1, "tankcd"}, -- Life Cocoon
     -- Uldir
     [265264] = {2, "alert"}, -- Void Lash (Zek'voz)
     -- Battle of Dazar'alor
     [285213] = {1, "alert"}, -- Caress of Death (Rastakhan)
-    [285195] = {12, "heal"}, -- Deathly Withering (Rastakhan)
+    [288415] = {1, "alert"}, -- Caress of Death in Death realm (Rastakhan)
+    [285195] = {8, "stacks"}, -- Deathly Withering (Rastakhan)
+    [286646] = {1, "heal"}, -- Gigavolt Charge (Mekkatorque)
+    [287891] = {1, "stacks"}, -- Sheep Shrapnel (Mekkatorque)
+    [285212] = {10, "stacks"}, -- Chilling Touch (Jaina)
 };
 
 local auraEvents = {};
 auraEvents.SPELL_AURA_APPLIED = function(frame, id, _, _, _, amount)
     if (amount == nil and watchedAuras[id][1] == 1) or (amount ~= nil and amount >= watchedAuras[id][1]) then
-        if watchedAuras[id][2] == "alert" then
-            frame.alert[id] = true;
-        else
-            frame.heal[id] = true;
-        end
+        amount = amount or 1;
+        frame[watchedAuras[id][2]][id] = amount;
     end
 end
 auraEvents.SPELL_AURA_APPLIED_DOSE = auraEvents.SPELL_AURA_APPLIED;
 auraEvents.SPELL_AURA_REFRESH = auraEvents.SPELL_AURA_APPLIED;
 auraEvents.SPELL_AURA_REMOVED = function(frame, id, _, _, _, amount)
     if amount == nil or amount == 0 then
-        if watchedAuras[id][2] == "alert" then
-            frame.alert[id] = nil;
-        else
-            frame.heal[id] = nil;
-        end
+        frame[watchedAuras[id][2]][id] = nil;
     end
 end
 auraEvents.SPELL_AURA_REMOVED_DOSE = auraEvents.SPELL_AURA_REMOVED;
index 57578c7..4301178 100644 (file)
@@ -52,6 +52,8 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes,
     f.prev = {} -- values stored from previous update
     f.alert = {}; -- alerting auras
     f.heal = {}; -- high healing auras
+    f.tankcd = {}; -- tank CD auras
+    f.stacks = {}; -- stacking aura tracking
     -- set up periodic updates
     updaters[f] = function()
         if f.updating then
@@ -137,10 +139,19 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes,
     f.text:SetPoint("CENTER", f, "CENTER", 0, -1);
     f.text:SetFont(STANDARD_TEXT_FONT, 13);
     f.text:Hide();
+    f.stack = f:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall");
+    f.stack:SetPoint("BOTTOMLEFT", f.background, "BOTTOMLEFT");
+    f.stack:Hide();
     f.ready = f:CreateTexture(nil, "OVERLAY");
     f.ready:SetPoint("TOPLEFT", f, "BOTTOMLEFT", 1, 15);
     f.ready:SetPoint("BOTTOMRIGHT", f, "BOTTOMLEFT", 15, 1);
     f.ready:Hide();
+    f.defensive = f:CreateTexture(nil, "OVERLAY");
+    f.defensive:SetPoint("TOPLEFT", f.background, "TOPLEFT", 1, -1);
+    f.defensive:SetWidth(6);
+    f.defensive:SetHeight(6);
+    f.defensive:SetColorTexture(1, 0.3, 0);
+    f.defensive:Hide();
     f.targeticon = f:CreateTexture(nil, "OVERLAY");
     f.targeticon:SetPoint("CENTER", f, "TOP", 0, -1);
     f.targeticon:SetWidth(12);
index f51d200..668f229 100644 (file)
@@ -17,11 +17,6 @@ local charmcolor = addon.Colors.OverlayColorCharm;
 local majorcolor = addon.Colors.OverlayColorAlert;
 local healcolor = addon.Colors.OverlayColorHeal;
 
-local function updateAuras()
-    -- TODO
-    return false;
-end
-
 function addon.FrameUpdate(frame)
     assert(type(frame) == "table", "FrameUpdate received invalid frame parameter!");
 
@@ -43,7 +38,6 @@ function addon.FrameUpdate(frame)
         if frame.shieldhl:IsShown() then frame.shieldhl:Hide() end
         if frame.healpred:IsShown() then frame.healpred:Hide() end
         if frame.healabsorb:IsShown() then frame.healabsorb:Hide() end
-        --if frame.auras:IsShown() then frame.auras:Hide() end
         frame.prev.health = nil;
         frame.prev.hmax = nil;
     elseif not UnitIsConnected(unit) then
@@ -54,7 +48,6 @@ function addon.FrameUpdate(frame)
         if frame.shieldhl:IsShown() then frame.shieldhl:Hide() end
         if frame.healpred:IsShown() then frame.healpred:Hide() end
         if frame.healabsorb:IsShown() then frame.healabsorb:Hide() end
-        --if frame.auras:IsShown() then frame.auras:Hide() end
         frame.prev.health = nil;
         frame.prev.hmax = nil;
     else
@@ -126,7 +119,20 @@ function addon.FrameUpdate(frame)
         elseif frame.healpred:IsShown() then
             frame.healpred:Hide();
         end
-        -- auras
+        -- tank CD marker
+        if next(frame.tankcd) then
+            if not frame.defensive:IsShown() then frame.defensive:Show() end
+        elseif frame.defensive:IsShown() then
+            frame.defensive:Hide();
+        end
+        -- aura stacks
+        if next(frame.stacks) then
+            frame.stack:SetText(next(frame.stacks));
+            if not frame.stack:IsShown() then frame.stack:Show() end
+        elseif frame.stack:IsShown() then
+            frame.stack:Hide();
+        end
+        -- overlays
         if next(frame.alert) then
             -- major
             if frame.overlay.color ~= majorcolor then