add notplayer filter
This commit is contained in:
@@ -61,6 +61,8 @@ L:RegisterTranslations("enUS", function()
|
||||
["In Combat"] = true,
|
||||
["Player"] = true,
|
||||
["Player Desc"] = "Only show player units",
|
||||
["Not Player"] = true,
|
||||
["Not Player Desc"] = "Only show NON player units",
|
||||
["Hostile"] = true,
|
||||
["Attackable"] = true,
|
||||
["Within 28 Range"] = true,
|
||||
@@ -255,6 +257,8 @@ L:RegisterTranslations("zhCN", function()
|
||||
["In Combat"] = "战斗中",
|
||||
["Player"] = "玩家",
|
||||
["Player Desc"] = "只显示玩家单位",
|
||||
["Not Player"] = "非玩家",
|
||||
["Not Player Desc"] = "只显示非玩家单位",
|
||||
["Hostile"] = "敌对",
|
||||
["Attackable"] = "可攻击",
|
||||
["Within 28 Range"] = "在28范围内",
|
||||
|
||||
@@ -13,6 +13,10 @@ filter.player = function(unit)
|
||||
return UnitIsPlayer(unit) and true or false
|
||||
end
|
||||
|
||||
filter.notplayer = function(unit)
|
||||
return not UnitIsPlayer(unit) and true or false
|
||||
end
|
||||
|
||||
filter.infight = function(unit)
|
||||
return UnitAffectingCombat(unit) and true or false
|
||||
end
|
||||
@@ -125,6 +129,10 @@ function Cursive:ShouldDisplayGuid(guid)
|
||||
shouldDisplay = shouldDisplay and filter.player(guid)
|
||||
end
|
||||
|
||||
if Cursive.db.profile.filternotplayer then
|
||||
shouldDisplay = shouldDisplay and filter.notplayer(guid)
|
||||
end
|
||||
|
||||
if Cursive.db.profile.filterignored then
|
||||
shouldDisplay = shouldDisplay and filter.notignored(guid)
|
||||
end
|
||||
|
||||
@@ -328,6 +328,18 @@ local mobFilters = {
|
||||
Cursive.db.profile.filterplayer = v
|
||||
end,
|
||||
},
|
||||
["notplayer"] = {
|
||||
type = "toggle",
|
||||
name = L["Not Player"],
|
||||
desc = L["Not Player Desc"],
|
||||
order = 33,
|
||||
get = function()
|
||||
return Cursive.db.profile.filternotplayer
|
||||
end,
|
||||
set = function(v)
|
||||
Cursive.db.profile.filternotplayer = v
|
||||
end,
|
||||
},
|
||||
["range"] = {
|
||||
type = "toggle",
|
||||
name = IsSpellInRange and L["Within 45 Range"] or L["Within 28 Range"],
|
||||
|
||||
Reference in New Issue
Block a user