Quantcast Question on addon loading - WoWInterface
Thread Tools Display Modes
07-12-09, 09:24 PM   #1
A Cyclonian
rossman's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 39
Question on addon loading

I am trying to get an addon to put something next to the nUI lat\micromenu\fps on the console. If I use SetPoint("RIGHT", nUI_MicroMenu, "LEFT", 0, 0) I do not get anything displayed. If I use SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -5, -2) it displays fine in the upper right hand corner.
I am trying to get Cargoship to put its LDBs next to the micromenu in the middle. I know I could change x.
Do the addons get processed in a-z order?
07-12-09, 09:44 PM   #2
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479

The solution to that is to create an event handler for "VARIABLES_LOADED" (or similar event), and run the code then.

local f = CreateFrame("frame")

function f.event()
   --your code here

f:SetScript("OnEvent", f.event)
07-12-09, 09:49 PM   #3
nUI's Author
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Because of how the layout engine in nUI works, it doesn't load the layout definition until the "VARIABLES_LOADED" event fires and does not create the layout until the "PLAYER_LOGIN" event fires. If you want to create an enhancement to nUI that depends on those elements being present to anchor to, then you should wait until the "PLAYER_LOGIN" or "PLAYER_ENTERING_WORLD" event.

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.

Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/

WoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Developer Chat » Question on addon loading

Thread Tools
Display Modes

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