View Single Post
03/26/20, 03:00 PM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,959
I thought the same some weeks ago Phinix.
Somehow I had erros which only happened if I tried to access the libraries at the beginning of my first loaded lua file in my addon.
The txt file had the library as ## DependsOn: so I thought all will be fine and the lib will be definately loaded BEFORE my addon's lua file is executed.
But sometimes it was working differently. Just coulnd't track down when.
As the lib was included into other addons (LibMainMenu) and even called hardcoded without ttx file I assumed it was somehting the other addons caused, cuz they don't use and txt file and DpendsOn tag.

I also told sirinsidiator about it and asked if it would make a difference if I move the libs "first" call in my lua file to my callback function of event_add_on_loaded, or if it is directly at teh start of the lua file.
He said it makes no difference as the ## (Optional)DependsOn handles the load of the library files properly before my lua file is loaded IF the lib got its own txt file and was added to my addon's ## DependsOn: tag.

All was setup properly, but I still got some error messages in the chat sometimes.

So I decided to move the lib stuff to the event_add_on_loaded callback function and since then the errors stopped. Might have been another addon or bad code somewhere. But also might be that there is somethign broken at the ZOs stuff of the dependencies under some circumstances...

Btw: This only happend with LibMainMenu for me so far so I really think it's because of other addons trying to access the lib to early. After cleaning up my addons and removing hardcoded lib calls most erros were gone as the addons were using the most up2date libraies directly from the AddOns directory, laoding them properly with their txt files.

So meanwhile I'd say it's not a general problem but related to the lib's loading and missing txt files, or wrong code somwhere.


@sirinsidiator:
pTC refers to the function TColor of LibPhinixFunctions. I can't find that in the list of the traceback?
So it might also be that pTC is just nil here cuz the lib LibPhinixFunctions function TColor is tried to be accessed before the library was loaded?

Last edited by Baertram : 03/26/20 at 03:10 PM.
  Reply With Quote