View Single Post
05-23-11, 06:57 PM   #2
Lordyfrb
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 71
Exclamation Allowing attachments to any element of the unit frames.

This is a simple 1 line change to Stuf\core.lua that names the individual elements of the unit frame(UF), thus allowing other frames to be attached to these elements.

If you didn't know Stuf doesn't name each of the UFs elements, it lets WoW name these with a generic table.
If you dont understand this start WoW with Stuf enabled, and type into to the chat box:
Code:
/fstack
Now mouse over any UF created by stuf, and look for a pop up. Check Img1.
See all those table references and somewhere in the middle is the reference to the UF.
Thats what I mean about Stuf letting WoW give tables names to the parts that make up the UF, so what you may say, we can just attach our frames to those tables and be done with it,
but heres the catch, WoW creates those names randomly each time and thus they are constantly changing. What we want is in img2. Now see how there's a few changes, we now have names for parts of the UF, so we can now attach frames to these parts.

This is how we go about making this change:

Open up Stuf\core.lua from inside your Interface\AddOns folder in your chosen editor.

And search for the following line:
Code:
local f = CreateFrame(frametype or "Frame", nil, uf)
and replace it with the following:
Code:
local f = CreateFrame(frametype or "Frame", "Stuf."..unit.."."..name, uf)
Now save the file and open WoW, or if you have WoW already opened type
Code:
/reload
You can now type
Code:
/fstack
and the changes should be done.

Thats all for this section.

Lordyfrb
Attached Thumbnails
Click image for larger version

Name:	img1.jpg
Views:	928
Size:	34.1 KB
ID:	6187  Click image for larger version

Name:	img2.jpg
Views:	882
Size:	31.9 KB
ID:	6188  
__________________
  Reply With Quote