display higher hp mobs first, add ignore list filter

This commit is contained in:
pepopo978
2025-04-05 15:02:05 -07:00
parent cb86e3cc92
commit 4ae2f14349
5 changed files with 99 additions and 6 deletions
+23 -1
View File
@@ -2,7 +2,8 @@ if not Cursive.superwow then
return
end
local filter = {}
local filter = {
}
filter.attackable = function(unit)
return UnitCanAttack("player", unit) and true or false
@@ -51,6 +52,23 @@ filter.hostile = function(unit)
return UnitIsEnemy("player", unit) and true or false
end
filter.notignored = function(unit)
if not Cursive.db.profile.ignorelist or table.getn(Cursive.db.profile.ignorelist) == 0 then
return true
end
local unitName = UnitName(unit)
if not unitName then
return true
end
for _, str in ipairs(Cursive.db.profile.ignorelist) do
if string.find(string.lower(unitName), string.lower(str)) then
return false
end
end
return true
end
Cursive.filter = filter
function Cursive:ShouldDisplayGuid(guid)
@@ -107,5 +125,9 @@ function Cursive:ShouldDisplayGuid(guid)
shouldDisplay = shouldDisplay and filter.player(guid)
end
if Cursive.db.profile.filterignored then
shouldDisplay = shouldDisplay and filter.notignored(guid)
end
return shouldDisplay
end