X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/325e20bb2d14520a10eb733206a8ef54c60fdad3..a7dd68bc57fdc3733ae09bdaef561a6df5e7b338:/OmaTMW/TellMeWhen.lua diff --git a/OmaTMW/TellMeWhen.lua b/OmaTMW/TellMeWhen.lua index 2deb9a3..6037c86 100644 --- a/OmaTMW/TellMeWhen.lua +++ b/OmaTMW/TellMeWhen.lua @@ -7,9 +7,47 @@ 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 = { - ["Stormreaver"] = { - ["Vildan"] = { + ["Sylvanas"] = { + ["Vildana"] = { { unit = "target", spec = 3, -- Retribution @@ -27,9 +65,50 @@ local chars = { auraFilter = "PLAYER HELPFUL", x = 570, y = 530, + width = 40, + height = 40, + }, + { + 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"] = { + { + unit = "target", + auras = {"Bursting With Pride"}, + auraFilter = "HELPFUL", + x = 570, -- placed over Innervate frame + y = 440, width = 80, height = 80, }, + { + unit = "player", + auras = {"Divine Purpose"}, + auraFilter = "PLAYER HELPFUL", + x = 570, + y = 530, + width = 40, + height = 40, + }, { unit = "player", spec = 2, -- Protection @@ -40,6 +119,15 @@ local chars = { width = 80, height = 80, }, + { + unit = "player", + auras = {"Seraphim", "Righteous Verdict"}, + auraFilter = "PLAYER HELPFUL", + x = 570, + y = 480, + width = 40, + height = 40, + }, { unit = "player", auras = {"Divine Shield"}, @@ -49,6 +137,46 @@ local chars = { width = 80, height = 80, }, + { + unit = "player", + auras = {"Devotion Aura"}, + auraFilter = "HELPFUL", + invert = true, + x = 720, + y = 440, + width = 60, + height = 60, + }, + }, + ["Gilden"] = { + { + unit = "target", + auras = {"Shadow Word: Pain", "Purge the Wicked"}, + auraFilter = "PLAYER HARMFUL", + x = 660, + y = 440, + width = 60, + height = 60, + }, + { + unit = "player", + auras = {"Power Word: Fortitude"}, + auraFilter = "HELPFUL", + invert = true, + x = 720, + y = 440, + width = 60, + height = 60, + }, + { + unit = "player", + auras = {"Overcharge Mana"}, + auraFilter = "PLAYER HELPFUL", + x = 720, + y = 440, + width = 60, + height = 60, + }, }, ["Gedren"] = { { @@ -78,6 +206,55 @@ local chars = { width = 40, height = 40, }, + { + unit = "player", + auras = {"Unleash Life"}, + auraFilter = "PLAYER HELPFUL", + x = 740, + y = 440, + width = 40, + height = 40, + }, + }, + ["Gran"] = { + { + 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, + }, + { + unit = "player", + auras = {"Unleash Life"}, + auraFilter = "PLAYER HELPFUL", + x = 740, + y = 440, + width = 40, + height = 40, + }, + }, + ["Gedrin"] = { + { + unit = "pet", + auras = {"Frenzy"}, + auraFilter = "HELPFUL", + x = 660, + y = 440, + width = 40, + height = 40, + }, }, }, }; @@ -86,7 +263,6 @@ local chars = { -- unit = unitID where to check auras, not required for totem checkers -- spec = player spec index to show frame, if nil show always -- auras = list of auras to track, in priority order --- iterateAuras = iterate over UnitAura() instead of auras list -- auraFilter = filter for UnitAura -- totems = list of totem slots to track, in priority order, only checked if auras is nil -- x = x position relative to UIParent bottom left @@ -98,27 +274,52 @@ local chars = { local settings = { { unit = "player", - auras = {"Innervate"}, + auras = {"Innervate", "Gift of the Titans", "Power Infusion"}, auraFilter = "HELPFUL", x = 570, y = 440, width = 80, height = 80, }, + { + unit = "player", + auras = {"Ineffable Truth"}, + auraFilter = "HELPFUL", + x = 570, + y = 440, + width = 40, + height = 40, + }, { unit = "player", auras = { "Delusions", "Entropic Blast", "Necrotic Embrace", "Flametouched", "Shadowtouched", "Blazing Eruption", "Shattering Scream", "Consuming Hunger", "Unstable Soul", - "Time Bomb", "Broken Shard", "Demolished", "Fetid Rot", + "Time Bomb", "Broken Shard", "Demolished", "Fetid Rot", "Roiling Deceit", + "Putrid Blood", "Endemic Virus", "Lingering Infection", "Gigavolt Charge", + "Crackling Lightning", "Storm's Wail", "Death's Door", "Deathly Withering", + "Chilling Touch", "Volatile Charge", "Liquid Gold", "Drained Soul", "Evoke Anguish", + "Ancient Curse", "Corrosion", "Debilitating Spit", "Tasty Morsel", "Encroaching Shadows", + "Corrupted Existence", "Madness Bomb", "Crimson Chorus", "Essence Sap", "Bloodlight", + "Arcane Vulnerability", "Wicked Laceration", "Withering Touch" }, - iterateAuras = true, -- typically fewer debuffs on player than this list auraFilter = "HARMFUL", x = 660, y = 530, width = 80, height = 80, }, + { + unit = "player", + auras = { + "Adaptive Membrane", "Gluttonous Miasma" + }, + auraFilter = "HARMFUL", + x = 660, + y = 780, + width = 160, + height = 160, + }, }; local frames = {}; @@ -137,52 +338,37 @@ local function updateAuraFrame(frame) if UnitExists(unit) and (not frame.spec or frame.spec == currentSpec) then local name, icon, count, duration, expires; local auraFilter = frame.auraFilter; - if frame.iterateAuras then - 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 > 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(); - else - frame.cd:Hide(); - end - frame.icon:SetTexture(icon); - frame:Show(); - return; + 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] and not frame.invert then + if count > 1 then + frame.stack:SetText(count); + frame.stack:Show(); + else + frame.stack:Hide(); end - i = i + 1; - end - else - for _, aura in pairs(frame.auras) do - name, _, icon, count, _, duration, expires = UnitAura(unit, aura, nil, 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(); - else - frame.cd:Hide(); - end - frame.icon:SetTexture(icon); - frame:Show(); - return; + if expires > 0 then + frame.cd:SetCooldown(expires - duration, duration); + frame.cd:Show(); + else + frame.cd:Hide(); end + frame.icon:SetTexture(icon); + frame:Show(); + return; + elseif frame.auras[name] and frame.invert then + frame.icon:SetTexture(icon); + frame:Hide(); + return; end + i = i + 1; + end + if frame.invert then + frame:Show(); -- not functional without first hiding once to get SetTexture + return; end end frame:Hide(); @@ -222,17 +408,15 @@ 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.iterateAuras = config.iterateAuras; - if frame.iterateAuras then + if config.auras then frame.auras = {}; for _, v in pairs(config.auras) do frame.auras[v] = true; end - else - frame.auras = config.auras; end frame.auraFilter = config.auraFilter; frame.totems = config.totems; + frame.invert = config.invert; frame:Hide(); frame.base = frame:CreateTexture(nil, "BACKGROUND"); frame.base:SetAllPoints(); @@ -242,6 +426,7 @@ local function createTMW(name, config, parent) frame.icon:SetPoint("BOTTOMRIGHT", frame.base, "BOTTOMRIGHT", -1, 1); frame.icon:SetTexCoord(0.07, 0.93, 0.07, 0.93); frame.stack = frame:CreateFontString(nil, "OVERLAY", "NumberFontNormalLarge"); + frame.stack:SetFont(STANDARD_TEXT_FONT, 26, "OUTLINE"); frame.stack:SetPoint("TOPLEFT"); frame.stack:Hide(); frame.cd = CreateFrame("Cooldown", name.."CD", frame, "CooldownFrameTemplate");