add player filter

This commit is contained in:
pepopo978
2025-01-08 11:16:15 -08:00
parent e865406b32
commit 0977eddd6d
3 changed files with 30 additions and 6 deletions
+8
View File
@@ -8,6 +8,10 @@ filter.attackable = function(unit)
return UnitCanAttack("player", unit) and true or false
end
filter.player = function(unit)
return UnitIsPlayer(unit) and true or false
end
filter.infight = function(unit)
return UnitAffectingCombat(unit) and true or false
end
@@ -103,5 +107,9 @@ function Cursive:ShouldDisplayGuid(guid)
shouldDisplay = shouldDisplay and filter.icon(guid)
end
if Cursive.db.profile.filterplayer then
shouldDisplay = shouldDisplay and filter.player(guid)
end
return shouldDisplay
end