nameplates: queue events to update call

This commit is contained in:
shagu
2021-12-07 01:34:51 +01:00
parent ee5b4714fd
commit ecbb1c0241
+7 -1
View File
@@ -463,7 +463,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
nameplates.OnEvent = function(frame)
local frame = frame or this
nameplates:OnDataChanged(frame)
frame.eventcache = true
end
nameplates.OnDataChanged = function(self, plate)
@@ -666,6 +666,12 @@ 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
-- trigger queued event update
if nameplate.eventcache then
nameplates:OnDataChanged(nameplate)
nameplate.eventcache = nil
end
-- cache target value
nameplate.istarget = target