From 1d0c5f4eeaebc845418f4f63eb82a722711b9910 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Mon, 29 Aug 2016 20:37:17 +0300 Subject: [PATCH] more attempts to fix damn nameplates --- ElvUI_SLE/modules/nameplates.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ElvUI_SLE/modules/nameplates.lua b/ElvUI_SLE/modules/nameplates.lua index cba57b0..3c14817 100644 --- a/ElvUI_SLE/modules/nameplates.lua +++ b/ElvUI_SLE/modules/nameplates.lua @@ -110,15 +110,22 @@ function N:UpdateRoster() end function N:StartRosterUpdate() - if not rosterTimer or N:TimeLeft(rosterTimer) == 0 then + if not rosterTimer then rosterTimer = N:ScheduleTimer(N.UpdateRoster, 1) end end +function N:NAME_PLATE_UNIT_ADDED(event, unit, frame) + local frame = frame or NP:GetNamePlateForUnit(unit); + N:UpdateCount(nil,"player", true) +end + function N:NAME_PLATE_UNIT_REMOVED(event, unit, frame, ...) local frame = frame or NP:GetNamePlateForUnit(unit); frame.UnitFrame.unit = nil frame.UnitFrame.threatInfo:SetText("") + frame.UnitFrame.targetcount:SetText("") + frame.UnitFrame.targetCount = 0 end function N:Initialize() @@ -128,6 +135,7 @@ function N:Initialize() self:RegisterEvent("GROUP_ROSTER_UPDATE", "StartRosterUpdate") self:RegisterEvent("UNIT_TARGET", "UpdateCount") self:RegisterEvent("NAME_PLATE_UNIT_REMOVED") + self:RegisterEvent("NAME_PLATE_UNIT_ADDED") E:Delay(.3, function() N:UpdateCount(nil,"player", true) end) function N:ForUpdateAll() -- 1.7.9.5