display higher hp mobs first, add ignore list filter
This commit is contained in:
+23
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user