From fd418a4ac7086e9ae7b29c48e3e13e73901c6c7e Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 23 Aug 2020 11:36:21 +0200 Subject: [PATCH] nameplates: use same alpha mechanism as in client * nameplates should be at maximum alpha while noting is selected. * inactive alpha is now only applied while something is in target. --- modules/nameplates.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 7ec1ac62..f83f125d 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -446,7 +446,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () local name = plate.original.name:GetText() local level = plate.original.level:IsShown() and plate.original.level:GetObjectType() == "FontString" and tonumber(plate.original.level:GetText()) or "??" local class, _, elite, player = GetUnitData(name, true) - local target = UnitExists("target") and plate.parent:GetAlpha() == 1 or nil + local target = plate.istarget local mouseover = UnitExists("mouseover") and plate.original.glow:IsShown() or nil local unitstr = target and "target" or mouseover and "mouseover" or nil local red, green, blue = plate.original.healthbar:GetStatusBarColor() @@ -598,8 +598,11 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () local target = UnitExists("target") and frame:GetAlpha() == 1 or nil local mouseover = UnitExists("mouseover") and original.glow:IsShown() or nil + -- cache target value + nameplate.istarget = target + -- set non-target plate alpha - if target then + if target or not UnitExists("target") then nameplate:SetAlpha(1) else frame:SetAlpha(.95)