Thread Tools Display Modes
05/11/19, 01:32 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,014
Originally Posted by Sordrak View Post
I guess i just ran into this here... LibAddonMenu present in an old version and me only supporting the new one.

No idea of how i should feel supporting both versions at the moment o_O

Thanks for the info btw.
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).
  Reply With Quote
05/11/19, 02:39 PM   #2
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

ESOUI » Developer Discussions » General Authoring Discussion » Let's get rid of LibStub!


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