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
+5 -1
View File
@@ -15,7 +15,7 @@ L:RegisterTranslations("enUS", function()
["Ignore targets with the specified spell texture already on them. Useful for ignoring targets that already have a shared debuff."] = true,
["Time threshold at which to allow refreshing a curse. Default is 0 seconds."] = true,
["Ignore the current target when choosing target for multicurse. Does not affect 'curse' command."] = true,
["Only choose players and ignore npcs when choosing target for multicurse. Does not affect 'curse' command."] = true,
["Only choose players and ignore npcs when choosing target for multicurse. Does not affect 'curse' command."] = true,
["/cursive curse <spellName:str>|<guid?:str>|<options?:List<str>>: Casts spell if not already on target/guid"] = true,
["/cursive multicurse <spellName:str>|<priority?:str>|<options?:List<str>>: Picks target based on priority and casts spell if not already on target"] = true,
["Target with the highest HP."] = true,
@@ -51,6 +51,8 @@ L:RegisterTranslations("enUS", function()
["Text Size"] = true,
["Scale"] = true,
["In Combat"] = true,
["Player"] = true,
["Player Desc"] = "Only show player units",
["Hostile"] = true,
["Attackable"] = true,
["Within 28 Range"] = true,
@@ -223,6 +225,8 @@ L:RegisterTranslations("zhCN", function()
["Text Size"] = "文本大小",
["Scale"] = "缩放",
["In Combat"] = "战斗中",
["Player"] = "玩家",
["Player Desc"] = "只显示玩家单位",
["Hostile"] = "敌对",
["Attackable"] = "可攻击",
["Within 28 Range"] = "在28范围内",
+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
+17 -5
View File
@@ -266,7 +266,7 @@ local mobFilters = {
type = "toggle",
name = L["Hostile"],
desc = L["Hostile"],
order = 2,
order = 11,
get = function()
return Cursive.db.profile.filterhostile
end,
@@ -278,7 +278,7 @@ local mobFilters = {
type = "toggle",
name = L["Attackable"],
desc = L["Attackable"],
order = 3,
order = 22,
get = function()
return Cursive.db.profile.filterattackable
end,
@@ -286,11 +286,23 @@ local mobFilters = {
Cursive.db.profile.filterattackable = v
end,
},
["player"] = {
type = "toggle",
name = L["Player"],
desc = L["Player Desc"],
order = 33,
get = function()
return Cursive.db.profile.filterplayer
end,
set = function(v)
Cursive.db.profile.filterplayer = v
end,
},
["range"] = {
type = "toggle",
name = IsSpellInRange and L["Within 45 Range"] or L["Within 28 Range"],
desc = IsSpellInRange and L["Within 45 Range"] or L["Within 28 Range"],
order = 4,
order = 44,
get = function()
return Cursive.db.profile.filterrange
end,
@@ -302,7 +314,7 @@ local mobFilters = {
type = "toggle",
name = L["Has Raid Mark"],
desc = L["Has Raid Mark"],
order = 5,
order = 55,
get = function()
return Cursive.db.profile.filterraidmark
end,
@@ -314,7 +326,7 @@ local mobFilters = {
type = "toggle",
name = L["Has Curse"],
desc = L["Only show units you have cursed"],
order = 6,
order = 66,
get = function()
return Cursive.db.profile.filterhascurse
end,