Thread Tools Display Modes
12/17/14, 05:57 PM   #1
BornDownUnder
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 59
Question AnchorFill error upon initial group creation...

I am currently working on updating WarLegend Group Frames to current API, etc. for re-release once I get hold of Lyeos...
So far I have managed to iron out everything to working order, with a helping hand on a couple of minor issues (Thank you again Garkin & Minceraft!)

I'm completely stumped on this one issue that I just can't get around... Every initial group creation per session the anchorfill for the background throws an error, once a reloadui is done, all is fine and working perfectly until next session or relog.

Here is the code if someone has any ideas as to how to resolve this one last issue:

Warning: Spoiler


Many thanks in advance if someone can throw some ideas/suggestions which lead to squashing this one last issue.
  Reply With Quote
12/17/14, 07:37 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
If I'm not mistaken, unit frames are created as needed, not immediately upon load. I think you should use:
Lua Code:
  1. local frameObj = UNIT_FRAMES:GetFrame("group"..num)
  2. local frame = frameObj.frame -- added in edit
  3. local name = frameObj.nameLabel
  4. local hp_bar = frameObj.healthBar
  5. -- etc

Last edited by merlight : 12/17/14 at 07:39 PM.
  Reply With Quote
12/18/14, 07:08 AM   #3
BornDownUnder
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 59
Originally Posted by merlight View Post
If I'm not mistaken, unit frames are created as needed, not immediately upon load. I think you should use:
Lua Code:
  1. local frameObj = UNIT_FRAMES:GetFrame("group"..num)
  2. local frame = frameObj.frame -- added in edit
  3. local name = frameObj.nameLabel
  4. local hp_bar = frameObj.healthBar
  5. -- etc
Thanks Merlight, I'll have to implement the change & test in a few days' time.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » AnchorFill error upon initial group creation...


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off