b2fb545 - Add healthstone warning
[wowui.git] / OmaAB / TellMeWhen.lua
index 65f810b..174507d 100644 (file)
@@ -77,9 +77,9 @@ local settings = {
     {
         unit = "player",
         auras = {
-            "Necrotic Embrace", "Flametouched", "Shadowtouched", "Blazing Eruption",
-            "Shattering Scream", "Consuming Hunger", "Unstable Soul", "Time Bomb",
-            "Broken Shard",
+            "Delusions", "Entropic Blast", "Necrotic Embrace", "Flametouched", "Shadowtouched",
+            "Blazing Eruption", "Shattering Scream", "Consuming Hunger", "Unstable Soul",
+            "Time Bomb", "Broken Shard",
         },
         auraFilter = "HARMFUL",
         x = 660,
@@ -98,7 +98,7 @@ for i = 1, MAX_BOSS_FRAMES do
 end
 local currentSpec = 0; -- 0 is invalid
 
-local Indicators = CreateFrame("Frame", "OmaTMW");
+local Indicators = CreateFrame("Frame", "OmaTMW", UIParent);
 
 local function updateAuraFrame(frame)
     local unit = frame.unit;
@@ -107,6 +107,12 @@ local function updateAuraFrame(frame)
         for _, aura in pairs(frame.auras) do
             name, _, icon, count, _, duration, expires =  UnitAura(unit, aura, nil, frame.auraFilter);
             if name then
+                if count > 0 then
+                    frame.stack:SetText(count);
+                    frame.stack:Show();
+                else
+                    frame.stack:Hide();
+                end
                 if expires > 0 then
                     frame.cd:SetCooldown(expires - duration, duration);
                     frame.cd:Show();
@@ -142,20 +148,22 @@ local function updateTotems(slot)
     end
 end
 
-local function createTMW(name, config)
-    local frame = CreateFrame("Frame", name, UIParent);
-    frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", config.x, config.y+config.height);
-    frame:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMLEFT", config.x+config.width, config.y);
+local function createTMW(name, config, parent)
+    local frame = CreateFrame("Frame", name, parent);
+    frame:SetPoint("TOPLEFT", parent, "BOTTOMLEFT", config.x, config.y+config.height);
+    frame:SetPoint("BOTTOMRIGHT", parent, "BOTTOMLEFT", config.x+config.width, config.y);
     frame.unit = config.unit;
     frame.spec = config.spec;
     frame.auras = config.auras;
     frame.auraFilter = config.auraFilter;
     frame.totems = config.totems;
     frame:Hide();
-    -- TODO a background, like Masque, stack count
+    -- TODO a background, like Masque
     frame.icon = frame:CreateTexture(nil, "ARTWORK");
     frame.icon:SetAllPoints();
     frame.icon:SetTexCoord(0.07, 0.93, 0.07, 0.93);
+    frame.stack = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightHuge"); -- TODO change to number font
+    frame.stack:SetPoint("TOPLEFT");
     frame.cd = CreateFrame("Cooldown", name.."CD", frame, "CooldownFrameTemplate");
     frame.cd:SetReverse(true);
     frame.cd:SetAllPoints();
@@ -164,6 +172,9 @@ end
 
 local function initialize()
     Indicators:SetFrameStrata("LOW");
+    Indicators:SetPoint("BOTTOMLEFT");
+    Indicators:SetWidth(1);
+    Indicators:SetHeight(1);
     currentSpec = GetSpecialization();
     local name, realm = UnitFullName("player");
     if chars[realm] and chars[realm][name] then
@@ -182,7 +193,7 @@ local function initialize()
                 table.insert(totems[slot], i);
             end
         end
-        frames[i] = createTMW("OmaTMW"..i, config);
+        frames[i] = createTMW("OmaTMW"..i, config, Indicators);
     end
 
     for _, frame in pairs(frames) do