|Go to Page...|
|Updated:||01/02/16 10:19 PM|
|Created:||01/02/16 10:19 PM|
It tracks what addons are loaded so you don't have to. It allows you to easily check and see if any addon is running. It also allows you to register your addon version number so that other addons can also see which version of your addon is running.How do I use it?
Benefits to registering your addons version number:
- Allows other addons to know which version of your addon is running.
- This can serve as a signal to let other addons know when your addon is done initializing and everything is ready & accessible to them.
Load the library in every lua file you wish to use it in:
- local LIBLA = LibStub:GetLibrary("LibLoadedAddons")
To register your addons version number:
* It is highly recommended that you wait until your addon is fully initialized before registering your addons version number. This way when other addons check to see if your addon is loaded they can check the version number to see if you are done initializing and know that everything is ready and accessible.
- LIBLA:RegisterAddon(string ADDON_NAME, number ADDON_VERSION)
- ADDON_VERSION must be of type(ADDON_VERSION) == number
- ADDON_NAME must match the name of your addon used for your addon folder & manifest. The same string you use in your OnAddonLoaded function.
To check if an addon is loaded:
- local isLoaded, versionNum = LIBLA:IsAddonLoaded("QuestTracker")
- Whether addons register their version number or not you can still see if they are loaded.
- The returned versionNum will be 0 if the addon has not registered their version number.