View Single Post
06/02/14, 03:23 AM   #9
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by lyravega View Post
Yeah, it makes sense now. When one fires, the other hasn't even been loaded. Other one needs to register first, so it has to load before but I cannot to that. What I can do is though, that simple if-check (if FTC then), and making sure FTC is loaded before. Cannot use callbacks there.
If you want to be certain another addon is loaded before yours (because you depend on it), add it to the "DependsOn"* entry in the manifest.
If the dependency is a optional one (if it is there you would prefer to go second, but if not you still can work) make it a Optional Dependency* in your manifest. I use this in Unified Chat Tabs to make certain local copies of BugEater and LibAddonMenu are loaded before my addon. BugEater because without Pre-Init debug message (like autoapply) have no chance of appearing. LAM because if there is a local copy it is propably more up to date then the version I have embedded (libStub entries in LAM files do the hard work here).

*See manifest help for proper syntax

For most purposes you can think of of the .lua files of your Addon as the constructor of your addon. The only non-function thing is that local scale variables defiend outside of functions persist after the constructor has been called. You can even cancel them via a conditional return (used for libs that use LibStub)
The loaded event is fired after all constrctors have been run already.
  Reply With Quote