View Single Post
12/19/14, 05:45 PM   #7
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Originally Posted by circonian View Post
It reads & writes the saved variables to each of the addons saved variable files and that will work just fine for me & my addons. But I was wondering if there is any way to grab the addon name that is loading the library?
Some way to be able to set the addon name dynamically in the libraries OnAddOnLoaded ... So that addon developers don't have to modify the library file to put their addon name in there?

1) Use EVENT_PLAYER_ACTIVATED instead. The drawback is you can't actually use the data before then. For research data, that might not be an issue.

1b) If users do need some sort of activate-level code on it, you could register callbacks to be fired when the SavedVariables is available. You could either write your own callback manager or use a ZO_CallbackObject (either your own or even EVENT_MANAGER).

2) The manual initialization function would work. Either set it as an explicit .init() or require users to only instantiate your library during the init function or later.

3) If Minion ever handles dependencies, you could just create it stand-alone. I know it was mentioned awhile back as a feature they were looking at doing, but who knows the timeline for that.

Last edited by Sasky : 12/19/14 at 05:47 PM.
  Reply With Quote