add filter for mobs that have curses

This commit is contained in:
pepopo978
2024-06-25 19:00:56 -07:00
parent cbfc7f1bfc
commit cd65ee960a
3 changed files with 28 additions and 0 deletions
+7
View File
@@ -172,6 +172,13 @@ function curses:ShouldPlayResistSound(guid)
return false
end
function curses:HasAnyCurse(guid)
if curses.guids[guid] and next(curses.guids[guid]) then
return true
end
return nil
end
function curses:HasCurse(spellName, targetGuid, minRemaining)
if not minRemaining then
minRemaining = 0 -- default to 0
+8
View File
@@ -12,6 +12,10 @@ filter.infight = function(unit)
return UnitAffectingCombat(unit) and true or false
end
filter.hascurse = function(unit)
return Cursive.curses:HasAnyCurse(unit) and true or false
end
filter.alive = function(unit)
return not UnitIsDead(unit) and true or false
end
@@ -74,6 +78,10 @@ function Cursive:ShouldDisplayGuid(guid)
shouldDisplay = shouldDisplay and filter.infight(guid)
end
if Cursive.db.profile.filterhascurse then
shouldDisplay = shouldDisplay and filter.hascurse(guid)
end
if Cursive.db.profile.filterhostile then
shouldDisplay = shouldDisplay and filter.hostile(guid)
end
+13
View File
@@ -31,6 +31,7 @@ Cursive:RegisterDefaults("profile", {
filterattackable = true,
filterrange = false,
filterraidmark = false,
filterhascurse = false,
})
local barOptions = {
@@ -223,6 +224,18 @@ local mobFilters = {
Cursive.db.profile.filterraidmark = v
end,
},
["hascurse"] = {
type = "toggle",
name = "Has Curse",
desc = "Only show units you have cursed",
order = 6,
get = function()
return Cursive.db.profile.filterhascurse
end,
set = function(v)
Cursive.db.profile.filterhascurse = v
end,
},
}
Cursive.cmdtable = {