View Single Post
03/20/22, 08:35 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,973
https://www.esoui.com/forums/showthread.php?t=9149
-> "Dependency type"

Optional means: The addon loads even though the dependency is missing/not given with the correct version
## AddOnVersion in that dependencies txt file needs to be >= (higher or equal) the versionNumber that is provided at the addon that adds that [optional] dependency via
Code:
## OptionalDependsOn: addonName>=versionNumber
If the optional dependency is found with the correct version it will be loaded prior to the addon that needs that optional dependency,
means the lua and xml files of the dependency will load before the addon adding that dependency and the event EVENT_ADD_ON_LOADED of the dependency also will fire before the one of the addon adding the dependency.

An optional dependency could e.g. be another addon which we need to check for in our code but we need to assure for that, that it loads before ou own addon. If we add the optional dependency it will load before ours and we are able to check in our EVENT_ADD_ON_LOADED if the other addon was loaded or check fo the other addons global variable (e.g. libraries like LibAddonMenu2).

Also optional dependency could be even this LibAddonMenu-2.0 if you "could" add a settings menu but this is optional and your addon even works without it, only usng e.g. slash commands.
So in both cases it would load, either with a settings menu or without.



Non optional dependencies, defined via ## DependsOn: are MUST dependencies: Means the addon adding those dependencies will NOT LOAD if that non-optionald dependency is missing or not provided with the correct version.

Last edited by Baertram : 03/20/22 at 08:41 AM.
  Reply With Quote