My nameplate addon I use in my Diablo style UI is causing me a few issues. The issue occurs mainly in PVP but I would assume any enviornement where lots of nameplates are created in short periods, or possibly just after a certain amount of been created regardless of how long the period is. I'm not entierly sure, anyhow, the error comes from my function to change the name shown on the nameplate to add the units level and if they are elite/boss/rare to add a symbol tag. Here's the function:
Lua Code:
--Name
local f = CreateFrame("Frame")
f:RegisterEvent("NAME_PLATE_UNIT_ADDED")
f:SetScript("OnEvent", function(f, event, ...)
if event == "NAME_PLATE_UNIT_ADDED" then
local unit = ...
local nameplate = C_NamePlate.GetNamePlateForUnit(unit)
if not nameplate then return end
hooksecurefunc("CompactUnitFrame_UpdateName", function (frame)
--Set the tag based on UnitClassification, can return "worldboss", "rare", "rareelite", "elite", "normal", "minus"
local tag
local level = UnitLevel(frame.unit)
if UnitClassification(frame.unit) == "worldboss" or UnitLevel(frame.unit) == -1 then
tag = BossTag
level = "??"
elseif UnitClassification(frame.unit) == "rare" or UnitClassification(frame.unit) =="rareelite" then
tag = RareTag
elseif UnitClassification(frame.unit) == "elite" then
tag = EliteTag
else
tag = ""
end
--Set the nameplate name to include tag(if any), name and level
frame.name:SetText(UnitName(frame.unit).." ("..level..")"..tag)
end)
end
end)
And here is the entire lua file for the addon:
https://github.com/galaxy119/Roth_UI...NamePlates.lua
I'm assuming calling "CompactUnitFrame_UpdateName" that many times is causing the issue, but I don't know of another way to update the name whenever a new nameplate is created.
Code:
13x C stack overflow
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
...
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: in function `CompactUnitFrame_UpdateName'
FrameXML\CompactUnitFrame.lua:288: in function `CompactUnitFrame_UpdateAll'
FrameXML\CompactUnitFrame.lua:171: in function `CompactUnitFrame_SetUnit'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:270: in function `OnAdded'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:59: in function `OnNamePlateAdded'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:24: in function <...eBlizzard_NamePlates\Blizzard_NamePlates.lua:18>
Locals:
and
Code:
29x ...ack\Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:51: [string "safecall Dispatcher[2]"]:1: chunk has too many syntax levels
[C]: ?
...ack\Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:51: in function <...ack\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
...ack\Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:55: in function <...ack\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:54>
...ack\Libs\CallbackHandler-1.0\CallbackHandler-1.0-6.lua:92: in function `Fire'
!BugGrabber\BugGrabber.lua:149: in function <!BugGrabber\BugGrabber.lua:147>
!BugGrabber\BugGrabber.lua:370: in function <!BugGrabber\BugGrabber.lua:292>
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
...
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: in function `CompactUnitFrame_UpdateName'
FrameXML\CompactUnitFrame.lua:288: in function `CompactUnitFrame_UpdateAll'
FrameXML\CompactUnitFrame.lua:171: in function `CompactUnitFrame_SetUnit'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:270: in function `OnAdded'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:59: in function `OnNamePlateAdded'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:24: in function <...eBlizzard_NamePlates\Blizzard_NamePlates.lua:18>
Locals: