Commit 4a3be780 authored by Adrian L Lange's avatar Adrian L Lange Committed by GitHub

Merge pull request #384 from oUF-wow/patch-nameplates

core: Set nameplate CVars immediately if already logged in
parents 6f72340f 3255715f
......@@ -696,7 +696,17 @@ function oUF:SpawnNamePlates(namePrefix, nameplateCallback, nameplateCVars)
eventHandler:RegisterEvent('NAME_PLATE_UNIT_ADDED')
eventHandler:RegisterEvent('NAME_PLATE_UNIT_REMOVED')
eventHandler:RegisterEvent('PLAYER_TARGET_CHANGED')
if(IsLoggedIn()) then
if(nameplateCVars) then
for cvar, value in next, nameplateCVars do
SetCVar(cvar, value)
end
end
else
eventHandler:RegisterEvent('PLAYER_LOGIN')
end
eventHandler:SetScript('OnEvent', function(_, event, unit)
if(event == 'PLAYER_LOGIN') then
if(nameplateCVars) then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment