ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   AnchorFill error upon initial group creation... (https://www.esoui.com/forums/showthread.php?t=4147)

BornDownUnder 12/17/14 05:57 PM

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.

merlight 12/17/14 07:37 PM

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

BornDownUnder 12/18/14 07:08 AM

Quote:

Originally Posted by merlight (Post 17902)
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.


All times are GMT -6. The time now is 07:32 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI