X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/96ad366e5121bcaaa6621ffac6d085fdbb34c34a..0453a59cf1f5c15fa46a1460dd12d372475b10f1:/OmaTMW/TellMeWhen.lua diff --git a/OmaTMW/TellMeWhen.lua b/OmaTMW/TellMeWhen.lua index fd9b0fc..dfea0d5 100644 --- a/OmaTMW/TellMeWhen.lua +++ b/OmaTMW/TellMeWhen.lua @@ -7,7 +7,88 @@ local UnitAura = UnitAura; local GetTotemInfo = GetTotemInfo; -- character specific frames +-- TODO try with auraFilter, remove characters, change to classes +--[[local classes = { + ["PALADIN"] = { + ["PLAYER HELPFUL"] = { + { + unit = "player", + auras = {["Divine Shield"]=1, ""}, + frames = { + [1] = { + x = 0, + y = 0, + width = 1, + height = 1, + }, + }, + }, + }, + }, +}; +local specs = { + [retSpecid] = { + ["PLAYER HELPFUL"] = { + { + unit = "player", + auras = {["Judgment"]=1}, + frames = { + [1] = { + }, + }, + }, + }, + ["PLAYER HARMFUL"] = { + { + }, + }, + }, +}; +--]] local chars = { + ["Sylvanas"] = { + ["Vildana"] = { + { + unit = "target", + spec = 3, -- Retribution + auras = {"Judgment"}, + auraFilter = "PLAYER HARMFUL", + x = 570, -- placed over Innervate frame + y = 440, + width = 80, + height = 80, + }, + { + unit = "player", + spec = 3, -- Retribution + auras = {"Divine Purpose"}, + auraFilter = "PLAYER HELPFUL", + x = 570, + y = 530, + width = 80, + height = 80, + }, + { + unit = "player", + spec = 2, -- Protection + auras = {"Shield of the Righteous"}, + auraFilter = "PLAYER HELPFUL", + x = 570, + y = 440, + width = 80, + height = 80, + }, + { + unit = "player", + auras = {"Divine Shield"}, + auraFilter = "PLAYER HELPFUL", + x = 660, + y = 440, + width = 80, + height = 80, + }, + }, + }, ["Stormreaver"] = { ["Vildan"] = { { @@ -52,13 +133,33 @@ local chars = { }, ["Gedren"] = { { - totems = {1}, - x = 570, + totems = {1}, -- Efflorescence + x = 660, y = 440, width = 80, height = 80, }, }, + ["Gazden"] = { + { + unit = "player", + auras = {"Tidal Waves"}, + auraFilter = "PLAYER HELPFUL", + x = 660, + y = 440, + width = 40, + height = 40, + }, + { + unit = "player", + auras = {"Healing Rain"}, + auraFilter = "PLAYER HELPFUL", + x = 700, + y = 440, + width = 40, + height = 40, + }, + }, }, }; @@ -89,7 +190,7 @@ local settings = { auras = { "Delusions", "Entropic Blast", "Necrotic Embrace", "Flametouched", "Shadowtouched", "Blazing Eruption", "Shattering Scream", "Consuming Hunger", "Unstable Soul", - "Time Bomb", "Broken Shard", + "Time Bomb", "Broken Shard", "Demolished", "Fetid Rot", }, auraFilter = "HARMFUL", x = 660, @@ -114,10 +215,14 @@ local function updateAuraFrame(frame) local unit = frame.unit; if UnitExists(unit) and (not frame.spec or frame.spec == currentSpec) then local name, icon, count, duration, expires; - 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 + local auraFilter = frame.auraFilter; + local i = 1; + while true do + name, icon, count, _, duration, expires = UnitAura(unit, i, auraFilter); + if not name then break end + -- possible improvement to add spellID as an option + if frame.auras[name] then + if count > 1 then frame.stack:SetText(count); frame.stack:Show(); else @@ -133,6 +238,7 @@ local function updateAuraFrame(frame) frame:Show(); return; end + i = i + 1; end end frame:Hide(); @@ -172,7 +278,12 @@ local function createTMW(name, config, parent) frame:SetPoint("BOTTOMRIGHT", parent, "BOTTOMLEFT", config.x+config.width, config.y); frame.unit = config.unit; frame.spec = config.spec; - frame.auras = config.auras; + if config.auras then + frame.auras = {}; + for _, v in pairs(config.auras) do + frame.auras[v] = true; + end + end frame.auraFilter = config.auraFilter; frame.totems = config.totems; frame:Hide(); @@ -247,7 +358,9 @@ Indicators:SetScript("OnEvent", function(self, event, arg1) currentSpec = GetSpecialization(); for _, frame in pairs(frames) do if frame.auras then updateAuraFrame(frame) end - if frame.totems then updateTotemFrame(frame) end + if frame.totems then + for _, slot in pairs(frame.totems) do updateTotemFrame(frame, slot) end + end end elseif event == "PLAYER_LOGIN" then initialize();