Thx.
Result:
Code-Snippets:
CONFIG
lua Code:
--RAID
raid = {
auras = {
--put every single spellid here that you want to be tracked, be it buff or debuff doesn't matter
--maximum number of icons displayed at a time = 1
--this is for important boss mechanics only, this is not for tracking healing HOTs etc
spelllist = {
--test
32407,
--CATACLYSM RAIDS
--maloriak
92980, --ice bomb
77786, --red phase consuming flames
},
show = true,
disableCooldown = true,
showBuffType = false,
showDebuffType = false,
size = 20,
},
},
FUNCTIONS
lua Code:
--fill the whitelist table automatically with all the spellids
local whitelist = {}
for i,spellid in pairs(cfg.units.raid.auras.spelllist) do
local spell = GetSpellInfo(spellid)
if spell then whitelist[spell] = true end
--if spell then table.insert(whitelist,spell,true) end
end
--custom aura filter
local customFilter = function(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID)
if(whitelist[name]) then return true end
end
--create aura func
local createAuras = function(self)
local f = CreateFrame("Frame", nil, self)
f.size = self.cfg.auras.size
f.num = 1
f:SetHeight(f.size)
f:SetWidth(f.size)
f:SetPoint("CENTER", self, "CENTER", 0, 0)
f.initialAnchor = "TOPLEFT"
f["growth-x"] = "RIGHT"
f["growth-y"] = "DOWN"
f.spacing = -f.size
f.disableCooldown = self.cfg.auras.disableCooldown
f.showDebuffType = self.cfg.auras.showDebuffType
f.showBuffType = self.cfg.auras.showBuffType
f.CustomFilter = customFilter
self.Auras = f
end
--aura icon func
local createAuraIcon = function(icons, button)
local bw = button:GetWidth()
if button.cd then
button.cd:SetPoint("TOPLEFT", 1, -1)
button.cd:SetPoint("BOTTOMRIGHT", -1, 1)
button.count:SetParent(button.cd)
end
button.count:ClearAllPoints()
button.count:SetPoint("TOPRIGHT", 4, 4)
button.count:SetTextColor(0.9,0.9,0.9)
button.count:SetFont(cfg.font,bw/1.8,"THINOUTLINE")
button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
button.overlay:SetTexture("Interface\\AddOns\\rTextures\\aura_square")
button.overlay:SetTexCoord(0,1,0,1)
button.overlay:SetPoint("TOPLEFT", -1, 1)
button.overlay:SetPoint("BOTTOMRIGHT", 1, -1)
button.overlay:SetVertexColor(0,0,0,1)
button.overlay:Show()
button.overlay.Hide = function() end
end
CALL
lua Code:
--auras
if self.cfg.auras.show then
createAuras(self)
self.Auras.PostCreateIcon = createAuraIcon
end
If more that one aura is found at a time they will overlay each other.