diff --git a/Localization.lua b/Localization.lua index c0fab73..6f32076 100644 --- a/Localization.lua +++ b/Localization.lua @@ -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范围内", diff --git a/filter.lua b/filter.lua index 258629a..960d0f8 100644 --- a/filter.lua +++ b/filter.lua @@ -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 diff --git a/settings.lua b/settings.lua index 7a42435..7ab6df2 100644 --- a/settings.lua +++ b/settings.lua @@ -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"],