View Single Post
02/02/23, 09:41 PM   #10
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,011
Yes the event manager lines are needed as the event_add_on_loaded is called for each addon once and your addon shoud not do anything BEFORE actually your addon was loaded -> indicated via the event by comparing the addon name to yours.
After that you unregister it so that no other addon loaded after your's is doing the name comparison again and again.

Same for addons that use savedvariables! If you initi them before event_add_on_loaded of your addon hits they will be re initalized later on and are empty then!
-> All explained at the esoui WIKI tutorials

Addons should always use that even unless your addon's purpose is not needing it because of no SV and only a simple code injection that could be loaded whenever you want it to load.
If you do not use the event the code is run as the files are read and that could be way too early, before other addons that you check with the txt manifest tag ## DependsOn or ## OptionallyDependsOn were loaded!


If your savedvariables do not save you either got a type in your SV table name in the lua code or in the txt manifest file behind the tag ## SavedVariables: <yourSVTableNameHere>? Compare them if they match completely!
Or you have stripped the event_Add_on_loaded and loaded your SV before and thus they are nil again as described above!
  Reply With Quote