Good Morning,
I am trying to create an aura filter for my oUF layout and I am a bit struggling because it doesn't really work like I want it - and I have no idea why.
Especially the target is the one who bothers me.
Here's my filter code, which I am adding to my layout per
Lua Code:
self.Buffs.CustomFilter = lib.AurasCustomFilter.target
self.Debuffs.CustomFilter = lib.AurasCustomFilter.target
I've commented inside the code, what I am trying to do ... but yeah, it doesn't work out exactly.
Lua Code:
local whitelist = cfg.debuffList
local isPlayer = {
player = true,
pet = true,
vehicle = true,
}
local dispelList = {
DRUID = {Curse = true, Poison = true},
MAGE = {Curse = true},
PALADIN = {Disease = true, Magic = true, Poison = true},
PRIEST = {Disease = true, Magic = true},
SHAMAN = {Curse = true, Disease = true, Poison = true}
}
local _, playerClass = UnitClass('player')
local dispel = dispelList[playerClass]
-- FILTER
lib.AurasCustomFilter = {
target = function(icons, unit, icon, name, _, _, _, dtype, _, _, caster, isStealable, shouldConsolidate, spellID, _, isBossAura, isCastByPlayer)
local _, instanceType = IsInInstance()
-- show when on whitelist
if whitelist[spellID] then
return true
-- show when is cast by boss
elseif isBossAura then
return true
-- show when in instance/party and npc (i.e. not boss, because isBossAura doesn't affect normal npc enemies)
elseif (instanceType == 'party' or instanceType == 'raid') and not UnitPlayerControlled(caster) then
return true
-- show when debuff and by me
elseif icon.isDebuff and isPlayer[caster] then
return true
-- show stealable buffs
elseif isStealable and not icon.isDebuff then
return true
-- show when by me and is not debuff
elseif isPlayer[caster] and not icon.isDebuff then
return true
-- hide rest
else
return false
end
end,
party = function(icons, unit, icon, name, _, _, _, dtype, _, _, caster, isStealable, shouldConsolidate, spellID, _, isBossAura, isCastByPlayer)
if isBossAura then
return true
elseif (dispel and dispel[dtype]) then
return true
else
return false
end
end,
focus = function(icons, unit, icon, name, _, _, _, dtype, _, _, caster, isStealable, shouldConsolidate, spellID, _, isBossAura, isCastByPlayer)
if isBossAura then
return true
elseif isPlayer[caster] then
return true
else
return false
end
end,
}
Hopefully someone can help me with that.
And sorry, if this is the wrong forum, I thought it would fit because it affects my oUF layout.