nameplates: keep target nameplate above others

Thanks @Otari98 for the idea and implementation via:
https://github.com/shagu/ShaguPlates/pull/30
This commit is contained in:
shagu
2024-09-28 11:05:47 +02:00
parent a9d2494fee
commit 577e88c18a
+14
View File
@@ -787,6 +787,20 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
nameplate.eventcache = nil
end
-- reset strata cache on target change
if nameplate.istarget ~= target then
nameplate.target_strata = nil
end
-- keep target nameplate above others
if target and nameplate.target_strata ~= 1 then
nameplate:SetFrameStrata("LOW")
nameplate.target_strata = 1
elseif not target and nameplate.target_strata ~= 0 then
nameplate:SetFrameStrata("BACKGROUND")
nameplate.target_strata = 0
end
-- cache target value
nameplate.istarget = target