I'm currently thinking about a new aura function for my raidframes. I want to display all aura icons being part of a boss encounter or spellid-whitelist.
The customfilter is searching for "boss" in the caster variable. If that is not found it tries to match the spellid.
Not sure if caster is actually filled with "boss" in boss encounters.
*edit* I just found out about "isBossDebuff". Nice.
*edit2*
This is what I'm currently using. Cannot test raid fights atm:
lua Code:
--whitelist
local whitelist = {}
if cfg.units.raid.auras.whitelist then
for _,spellid in pairs(cfg.units.raid.auras.whitelist) do
local spell = GetSpellInfo(spellid)
if spell then whitelist[spellid] = true end
end
end
--blacklist
local blacklist = {}
if cfg.units.raid.auras.blacklist then
for _,spellid in pairs(cfg.units.raid.auras.blacklist) do
local spell = GetSpellInfo(spellid)
if spell then blacklist[spellid] = true end
end
end
--custom aura filter
local customFilter = function(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff)
local ret = false
if(blacklist[spellID]) then
ret = false
elseif(whitelist[spellID]) then
ret = true
elseif isBossDebuff then
ret = true
elseif caster and caster:match("(boss)%d?$") == "boss" then
ret = true
end
return ret
end
--create aura func
local createAuras = function(self)
local f = CreateFrame("Frame", nil, self)
local cfg = self.cfg.auras
f.size = cfg.size or 26
f.num = cfg.num or 5
f.spacing = cfg.spacing or 5
f.initialAnchor = cfg.initialAnchor or "TOPLEFT"
f["growth-x"] = cfg.growthX or "RIGHT"
f["growth-y"] = cfg.growthY or "DOWN"
f.disableCooldown = cfg.disableCooldown or false
f.showDebuffType = cfg.showDebuffType or false
f.showBuffType = cfg.showBuffType or false
if not cfg.doNotUseCustomFilter then
f.CustomFilter = customFilter
end
f:SetHeight(f.size)
f:SetWidth((f.size+f.spacing)*f.num)
if cfg.pos then
f:SetPoint(cfg.pos.a1 or "CENTER", self, cfg.pos.a2 or "CENTER", cfg.pos.x or 0, cfg.pos.y or 0)
else
f:SetPoint("CENTER",0,-5)
end
self.Auras = f
end