oUF

101k Downloads

Error when processing spawn header for raid frames

joker-119 opened this issue ยท 5 comments

commented
local groups, group = {}, nil
for i=1, NUM_RAID_GROUPS do
local name = "Roth_UIRaidGroup"..i
local raidDragFrame = CreateFrame("Frame", "Roth_UIRaidDragFrame"..i, UIParent)
raidDragFrame:SetSize(50,50)
raidDragFrame:SetPoint(cfg.units.raid.pos.a1,cfg.units.raid.pos.af,cfg.units.raid.pos.a2,5,cfg.units.raid.pos.y)
func.applyDragFunctionality(raidDragFrame)
table.insert(Roth_UI_Units,"Roth_UIRaidDragFrame"..i) --add frames to the slash command function
  group = oUF:SpawnHeader(
    name,
    nil,
    attr.visibility,
    "showPlayer",         attr.showPlayer,
    "showSolo",           attr.showSolo,
    "showParty",          attr.showParty,
    "showRaid",           attr.showRaid,
    "point",              attr.point,
    "yOffset",            attr.yOffset,
    "xoffset",            attr.xoffset,
    "groupFilter",        tostring(i),
    "maxColumns",         attr.maxColumns,
    "unitsPerColumn",     attr.unitsPerColumn,
    "columnSpacing",      attr.columnSpacing,
    "columnAnchorPoint",  attr.columnAnchorPoint,
    "oUF-initialConfigFunction", ([[
      self:SetWidth(%d)
      self:SetHeight(%d)
    ]]):format(128, 64)
  )
	group:SetPoint("TOPLEFT", raidDragFrame, 0, 0)
	groups[i] = group

I get the error:

Message: bad argument #3 to '?' (Usage: local line = self:CreateFontString([name, drawLayer, templateName]))
Stack:
[Interface/AddOns/Roth_UI/embeds/oUF/ouf.lua]:700: in function 'SpawnHeader'
[Interface/AddOns/Roth_UI/units/raid.lua]:530: in main chunk`

raid.lua:530 is the SpawnHeader() call above.
ouf.lua:700 is RegisterAttributeDriver in the section of code below:

if(visibility) then
    local type, list = string.split(' ', visibility, 2)
    if(list and type == 'custom') then
        RegisterAttributeDriver(header, 'state-visibility', list)
        header.visibility = list
    else

Oddly, this affects the raid frames, but not the party frames, which also have a custom visibility condition, however using that condition on the raid frames, produces the same result (error shown above).

commented

You've not using fontstring widgets correctly somewhere in the layout, nothing specific to oUF.

commented

Is there any way to get an actual line number that's more useful than just pointing to the SpawnHeader function as the problem?

commented

We could probably tune some stuff, but I'd require the exact and entire code you used to produce this error.

commented

I was able to find and fix the issue , the raid frames called a function of mine that was using CreateFontString incorrectly in another file, as you indicated.

If it's possible to make future issues like that not just "Hey, error happened in SpawnHeader" when it's infact our own monkey brain code causing the issue, here's the addon that caused it:

https://www.wowinterface.com/downloads/info24094-RothUIDiabloGalaxysRevival.html

The update I did earlier (before testing raid frames) is still pending I think, but it'll be ver 3.3.0 that has the issue (incase I update it again before you get a chance to snag the code)

commented

Since this is secure code, the secure implementation will just blame whatever called it, and it might not be possible to put the blame in the correct place, but I'll take a look when I have some free time.