WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   nUI: Developer Chat (https://www.wowinterface.com/forums/forumdisplay.php?f=96)
-   -   Question on addon loading (https://www.wowinterface.com/forums/showthread.php?t=25398)

rossman 07-12-09 09:24 PM

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?
Thanks

Akryn 07-12-09 09:44 PM

Yes.

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

Code:

local f = CreateFrame("frame")

function f.event()
  --your code here
end

f:SetScript("OnEvent", f.event)
f:RegisterEvent("VARIABLES_LOADED")


spiel2001 07-12-09 09:49 PM

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.


All times are GMT -6. The time now is 06:10 PM.

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