Thread Tools Display Modes
02-26-18, 04:06 AM   #1
Eungavi
A Theradrim Guardian
Join Date: Nov 2017
Posts: 64
What's the *statFrame* that is being referred in PaperDollFrame.lua?

So, I'm trying to add some extra info on CharacterStatsPane and had a brief look at PaperDollFrame.lua.
Each stats have their updateFunc which has statFrame as first parameter and it seems to be a FramePoolObject that I am not certainly familiar with.

Could I get some brief explanation on what it is and how it works?

Thank you in advance!

Last edited by Eungavi : 02-26-18 at 07:00 AM.
  Reply With Quote
02-27-18, 10:22 PM   #2
Xodiv
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 6
A FramePool is ... a pool of re-usable frames.

See: http://www.wowinterface.com/forums/s...ad.php?t=55626

and SharedXML/Pools.lua

In your case they are CharacterStateFrameTemplate frames.

Code:
local statFrame = CharacterStatsPane.statsFramePool:Acquire();
Pulls out one, as if it had said

Code:
local statFrame = CreateFrame("FRAME", nil, CharacterStatsPane, "CharacterStateFrameTemplate")
but without the overhead of making one from scratch every time.
  Reply With Quote
02-28-18, 04:59 AM   #3
Eungavi
A Theradrim Guardian
Join Date: Nov 2017
Posts: 64
Originally Posted by Xodiv View Post
A FramePool is ... a pool of re-usable frames.

See: http://www.wowinterface.com/forums/s...ad.php?t=55626

and SharedXML/Pools.lua

In your case they are CharacterStateFrameTemplate frames.

Code:
local statFrame = CharacterStatsPane.statsFramePool:Acquire();
Pulls out one, as if it had said

Code:
local statFrame = CreateFrame("FRAME", nil, CharacterStatsPane, "CharacterStateFrameTemplate")
but without the overhead of making one from scratch every time.
That's interesting

So, the frame pool manages itself of objects as long as we provide create and reset function?
Sounds very handy!

Last edited by Eungavi : 02-28-18 at 05:04 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » What's the *statFrame* that is being referred in PaperDollFrame.lua?


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