View Single Post
12/19/14, 05:13 PM   #6
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
I guess at the very least if there is no way to grab the addon name for the addon that is loading the library I could have them manually call an initialize function for the library (Instead of using EVENT_ADD_ON_LOADED) and just use a flag to make sure the initialize code only gets run once.
Lua Code:
  1. local bHasBeenInitialized = false
  2.  
  3. function LibNeed4ResearchInitialize()
  4.     if bHasBeenInitialized then return end
  5.     bHasBeenInitialized = true
  6.    
  7.     ln4r.AccountSavedVariables = ZO_SavedVars:NewAccountWide("Need4ResearchVars", 1, nil, varDefaults)
  8.     ASV = ln4r.AccountSavedVariables
  9.     UpdateTables()
  10.     EVENT_MANAGER:UnregisterForEvent("LibNeed4Research", EVENT_ADD_ON_LOADED)
  11. end

Last edited by circonian : 12/19/14 at 05:15 PM.
  Reply With Quote