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.
This commit is contained in:
shagu
2020-08-23 11:37:40 +02:00
parent b4272662be
commit fd418a4ac7
+5 -2
View File
@@ -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)