Added HasDebuffs utility method

This commit is contained in:
Parnic
2018-08-27 20:48:13 -05:00
parent 32e2ce3902
commit ccdabc210c

View File

@ -437,7 +437,7 @@ end
do do
local retval = {} local retval = {}
function IceHUD:HasBuffs(unit, spellIDs) function IceHUD:HasBuffs(unit, spellIDs, filter)
for i=1, #spellIDs do for i=1, #spellIDs do
retval[i] = false retval[i] = false
end end
@ -445,9 +445,9 @@ do
local i = 1 local i = 1
local name, _, texture, applications, _, _, _, _, _, _, auraID local name, _, texture, applications, _, _, _, _, _, _, auraID
if IceHUD.WowVer < 80000 then if IceHUD.WowVer < 80000 then
name, _, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i) name, _, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i, filter)
else else
name, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i) name, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i, filter)
end end
while name do while name do
for i=1, #spellIDs do for i=1, #spellIDs do
@ -459,14 +459,18 @@ do
i = i + 1 i = i + 1
if IceHUD.WowVer < 80000 then if IceHUD.WowVer < 80000 then
name, _, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i) name, _, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i, filter)
else else
name, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i) name, texture, applications, _, _, _, _, _, _, auraID = UnitAura(unit, i, filter)
end end
end end
return retval return retval
end end
function IceHUD:HasDebuffs(unit, spellIDs, filter)
return IceHUD:HasBuffs(unit, spellIDs, filter and filter.."|HARMFUL" or "HARMFUL")
end
end end
function IceHUD:OnDisable() function IceHUD:OnDisable()