Commit 4d8cf7ff authored by Simpy's avatar Simpy 🐹

allow the variables of the aura to be stored for plugins to access in some...

allow the variables of the aura to be stored for plugins to access in some event they want it without replacing a function we can just store it's fine, maybe WA will use this too somehow easier this way
parent 70549237
......@@ -331,14 +331,12 @@ function NP:AuraFilter(unit, button, name, _, _, debuffType, duration, expiratio
local parent = button:GetParent()
local parentType = parent.type
local db = NP.db.units[parent.__owner.frameType] and NP.db.units[parent.__owner.frameType][parentType]
if not db then
return true
end
if not db then return true end
local isPlayer = (caster == 'player' or caster == 'vehicle')
local isFriend = unit and UnitIsFriend('player', unit) and not UnitCanAttack('player', unit)
-- keep these same as in `UF:AuraFilter`
button.isPlayer = isPlayer
button.isFriend = isFriend
button.isStealable = isStealable
......@@ -347,14 +345,13 @@ function NP:AuraFilter(unit, button, name, _, _, debuffType, duration, expiratio
button.expiration = expiration
button.name = name
button.spellID = spellID
button.owner = caster
button.spell = name
button.priority = 0
if not db.filters then
return true
end
if not db.filters then return true end
local priority = db.filters.priority
local noDuration = (not duration or duration == 0)
local allowDuration = noDuration or (duration and (duration > 0) and db.filters.maxDuration == 0 or duration <= db.filters.maxDuration) and (db.filters.minDuration == 0 or duration >= db.filters.minDuration)
local filterCheck
......
......@@ -513,14 +513,10 @@ function UF:AuraFilter(unit, button, name, _, _, debuffType, duration, expiratio
local parent = self:GetParent()
local db = parent.db and parent.db[self.type]
if not db then
return true
end
local filterCheck, isUnit, isFriend, isPlayer, canDispell, allowDuration, noDuration, spellPriority
if not db then return true end
isPlayer = (caster == 'player' or caster == 'vehicle')
isFriend = unit and UnitIsFriend('player', unit) and not UnitCanAttack('player', unit)
local isPlayer = (caster == 'player' or caster == 'vehicle')
local isFriend = unit and UnitIsFriend('player', unit) and not UnitCanAttack('player', unit)
button.isPlayer = isPlayer
button.isFriend = isFriend
......@@ -530,16 +526,17 @@ function UF:AuraFilter(unit, button, name, _, _, debuffType, duration, expiratio
button.expiration = expiration
button.name = name
button.spellID = spellID
button.owner = caster --what uses this?
button.spell = name --what uses this? (SortAurasByName?)
button.owner = caster
button.spell = name
button.priority = 0
noDuration = (not duration or duration == 0)
allowDuration = noDuration or (duration and (duration > 0) and (db.maxDuration == 0 or duration <= db.maxDuration) and (db.minDuration == 0 or duration >= db.minDuration))
local noDuration = (not duration or duration == 0)
local allowDuration = noDuration or (duration and (duration > 0) and (db.maxDuration == 0 or duration <= db.maxDuration) and (db.minDuration == 0 or duration >= db.minDuration))
local filterCheck, spellPriority
if db.priority ~= '' then
isUnit = unit and caster and UnitIsUnit(unit, caster)
canDispell = (self.type == 'buffs' and isStealable) or (self.type == 'debuffs' and debuffType and E:IsDispellableByMe(debuffType))
local isUnit = unit and caster and UnitIsUnit(unit, caster)
local canDispell = (self.type == 'buffs' and isStealable) or (self.type == 'debuffs' and debuffType and E:IsDispellableByMe(debuffType))
filterCheck, spellPriority = UF:CheckFilter(name, caster, spellID, isFriend, isPlayer, isUnit, isBossDebuff, allowDuration, noDuration, canDispell, casterIsPlayer, strsplit(",", db.priority))
if spellPriority then button.priority = spellPriority end -- this is the only difference from auarbars code
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment