View Single Post
05/11/19, 02:39 PM   #26
Sordrak
 
Sordrak's Avatar
AddOn Author - Click to view addons
Join Date: May 2017
Posts: 52
Originally Posted by Baertram View Post
I did it like described above.
First check if the global variable LibAddonMenu2 exists and use it for your local instance of LAM, and if not check if LibStub is loaded and load the lib via this way.
After this check if your local instance of LAM is there and if not abort your addon with an error message (e.g. use assert() function to do so).
Yes and no.

I agree with the approach of moving the libraries directly to the AddOn folder and getting rid of lib directories within AddOns.

Furthermore, i agree with the approach of removing the LibStub part. That's actually why I began to change my AddOns.

Yet I didn't expect this behavior at the beginning and I don't think the benefit is really huge in the way things are currently.

What I expected was that the AddOn doesn't get loaded at all without the dependencies. The behavior should be managed directly by ZOS / ESO trough DependsOn. Yet, I find myself having to add additional code (instead of getting rid of it) to verify if there isn't a library loaded the old way.

Which actually means for me that the benefit isn't huge. If I want the AddOn to run everywhere fine, I would still have to add the library to my AddOn as otherwise it wouldn't run and I would have to handle that case. I don't see an assert / printing a message as very useful or the way I'd like it to be.

Not sure how I'll adjust my AddOn now... guess I'll see.
  Reply With Quote