ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Chit-Chat (https://www.esoui.com/forums/forumdisplay.php?f=2)
-   -   optional dependencies (https://www.esoui.com/forums/showthread.php?t=10110)

Octopuss 03/20/22 06:24 AM

optional dependencies
 
Could anyone explain what this means? English is not my native language so I might be missing something, but I always thought that when something depends on something else, it's a hard requirement, so how can a dependency be optional?

Sharlikran 03/20/22 07:50 AM

Let's say for Quest Map it has an optional dependency for a text box. So when you type a slash command a list of hidden quests appears in the text box. If the author made that optional then when you load the mod the game checks both required and optional libraries. If you are missing the requirements then the mod doesn't load. If you are missing the optional dependency then the mod will load anyway because the author checks to see if the dependency is loaded before using it. Authors have to specify the optional dependency in a special text file to ensure that the game loads the optional dependency prior to the mod.

Baertram 03/20/22 08:35 AM

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.


All times are GMT -6. The time now is 12:24 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI