nameplates: ignore updates on invisible plates

This commit is contained in:
shagu
2022-07-16 10:52:49 +02:00
parent 1c980d3417
commit 7a9f0e39d3
+4
View File
@@ -468,6 +468,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
end
nameplates.OnDataChanged = function(self, plate)
local visible = plate:IsVisible()
local hp = plate.original.healthbar:GetValue()
local hpmin, hpmax = plate.original.healthbar:GetMinMaxValues()
local name = plate.original.name:GetText()
@@ -482,6 +483,9 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
elite = plate.original.levelicon:IsShown() and not player and "boss" or elite
if not class then plate.wait_for_scan = true end
-- skip data updates on invisible frames
if not visible then return end
-- target event sometimes fires too quickly, where nameplate identifiers are not
-- yet updated. So while being inside this event, we cannot trust the unitstr.
if event == "PLAYER_TARGET_CHANGED" then unitstr = nil end