Grays out enemy npc nameplates when tapped (#83)

* tapped targets show a gray nameplate

* toggle for users
This commit is contained in:
Jake Demian
2025-11-13 14:22:07 -05:00
committed by GitHub
parent 4fb8a24576
commit 494ebbd885
3 changed files with 16 additions and 1 deletions
@@ -10,6 +10,10 @@ local UnitClass = UnitClass
local UnitReaction = UnitReaction
local UnitIsConnected = UnitIsConnected
local CreateFrame = CreateFrame
local UnitIsTapped = UnitIsTapped
local UnitIsTappedByPlayer = UnitIsTappedByPlayer
local UnitIsDeadOrGhost = UnitIsDeadOrGhost
local UnitIsPlayer = UnitIsPlayer
function NP:Health_UpdateColor(_, unit)
if not unit or self.unit ~= unit then return end
@@ -35,6 +39,12 @@ function NP:Health_UpdateColor(_, unit)
element.r, element.g, element.b = r, g, b -- save these for the style filter to switch back
end
local db = NP:PlateDB(self)
if db.greyTappedTargets and UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) and not UnitIsPlayer(unit) and not UnitIsDeadOrGhost(unit) then
r, g, b = 0.5, 0.5, 0.5
element.r, element.g, element.b = r, g, b
end
local sf = NP:StyleFilterChanges(self)
if sf.HealthColor then
r, g, b = sf.HealthColor.r, sf.HealthColor.g, sf.HealthColor.b
+3 -1
View File
@@ -671,7 +671,9 @@ P.nameplates = {
markTanks = true,
},
FRIENDLY_NPC = {},
ENEMY_NPC = {},
ENEMY_NPC = {
greyTappedTargets = true,
},
},
}
+3
View File
@@ -67,6 +67,9 @@ local function GetUnitSettings(unit, name)
group.args.general.args.visibilityShortcut = ACH:Execute(L["Visibility"], nil, 100, function() ACD:SelectGroup('ElvUI', 'nameplates', 'generalGroup', 'general', 'plateVisibility') end)
group.args.general.args.nameOnly = ACH:Toggle(L["Name Only"], nil, 101)
group.args.general.args.showTitle = ACH:Toggle(L["Show Title"], L["Title will only appear if Name Only is enabled or triggered in a Style Filter."], 102)
if unit == 'ENEMY_NPC' then
group.args.general.args.greyTappedTargets = ACH:Toggle(L["Grey Tapped Targets"], L["Make tapped targets appear greyed out."], 103)
end
group.args.general.args.smartAuraPosition = ACH:Select(L["Smart Aura Position"], L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."], 104, C.Values.SmartAuraPositions)
group.args.healthGroup = ACH:Group(L["Health"], nil, 2, nil, function(info) return E.db.nameplates.units[unit].health[info[#info]] end, function(info, value) E.db.nameplates.units[unit].health[info[#info]] = value NP:ConfigureAll() end)