Commit 9753fa4d authored by kizedek's avatar kizedek
Browse files

Added [Unit has Stealable Buff] style filter trigger

parent 7d2b6e1e
......@@ -165,6 +165,18 @@ function E:IsDispellableByMe(debuffType)
return dispel and dispel[debuffType]
end
function E:UnitHasStealableBuff(unit)
if not unit then return false end
for i=1,40 do
local name,_,_,_,_,_,_,isStealable = UnitAura(unit, i, "HELPFUL")
if not name then return false end
if isStealable then return true end
end
return false
end
do
local function SetOriginalHeight(f)
if InCombatLockdown() then
......
......@@ -728,6 +728,12 @@ function mod:StyleFilterConditionCheck(frame, filter, trigger)
if (trigger.playerCanAttack and canAttack) or (trigger.playerCanNotAttack and not canAttack) then passed = true else return end
end
-- Unit has Stealable Buff
if trigger.unitHasStealableBuff or trigger.unitHasNoStealableBuff then
local hasStealableBuff = E:UnitHasStealableBuff(frame.unit)
if (trigger.unitHasStealableBuff and hasStealableBuff) or (trigger.unitHasNoStealableBuff and not hasStealableBuff) then passed = true else return end
end
-- Classification
if trigger.classification.worldboss or trigger.classification.rareelite or trigger.classification.elite or trigger.classification.rare or trigger.classification.normal or trigger.classification.trivial or trigger.classification.minus then
if trigger.classification[frame.classification] then passed = true else return end
......
......@@ -1173,6 +1173,18 @@ local function UpdateFilterGroup()
desc = L["If enabled then the filter will only activate when the unit can not be attacked by the active player."],
order = 23
},
unitHasStealableBuff = {
type = "toggle",
name = L["Unit has Stealable Buff"],
desc = L["If enabled then the filter will only activate when the unit has a stealable buff."],
order = 24
},
unitHasNoStealableBuff = {
type = "toggle",
name = L["Unit has no Stealable Buff"],
desc = L["If enabled then the filter will only activate when the unit has no stealable buff."],
order = 25
},
}
}
}
......
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