ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Site help, bugs, suggestions/questions (https://www.esoui.com/forums/forumdisplay.php?f=18)
-   -   Addon dependencies (https://www.esoui.com/forums/showthread.php?t=8069)

usmth 05/25/19 03:37 AM

Yo! Any new information about this feature? :)

sirinsidiator 05/25/19 03:51 AM

Quote:

Originally Posted by usmth (Post 38175)
Yo! Any new information about this feature? :)

It's still in being worked on. Just takes a bit longer due to a lack of time.

usmth 05/25/19 06:24 AM

Quote:

Originally Posted by sirinsidiator (Post 38176)
It's still in being worked on. Just takes a bit longer due to a lack of time.

Top-notch <3

Celarra 05/25/19 02:49 PM

I am having the same problem. My Master Merchant will not work. Can not find out why. It say dependency. What is that?
:mad:

Baertram 05/25/19 04:07 PM

Quote:

Originally Posted by Celarra (Post 38182)
I am having the same problem. My Master Merchant will not work. Can not find out why. It say dependency. What is that?
:mad:

Dependency = other source code needed like in libraries.
Just click the Master Merchant entry in the addon manager and expand it and there you'll find the "deoendencies" listed you need to install (e.g. LibStub, LibAddonMenu-2.0, ...)
Or install "Votans Addon List" and you'll see the dependencies in the red (i) icon on the right side in the row of the addon. If you already own the dependencies it will automatically enable it for you.

Enodoc 05/25/19 05:21 PM

Related query - since Elsweyr released, many people are now saying "you install Libraries separately". Is that technically accurate (and therefore advisable), or is it a misinterpretation on what ZOS have actually done?

In other words, should I still be including Libraries within my add-on in a Libs folder with OptionalDependsOn in my manifest, or should I be using DependsOn in my manifest, without a Libs folder, and stating the Libraries should be standalone and installed separately as prerequisites?

sirinsidiator 05/26/19 03:59 AM

Quote:

Originally Posted by Enodoc (Post 38189)
In other words, should I still be including Libraries within my add-on in a Libs folder with OptionalDependsOn in my manifest, or should I be using DependsOn in my manifest, without a Libs folder, and stating the Libraries should be standalone and installed separately as prerequisites?

As an author, you switch away from the LibStub embedded way of adding source files to your own manifest. Instead you should use DependsOn for libraries that have to be loaded and OptionalDependsOn for libs that may be loaded. In any case you will have to check the library if it has been updated to support this.

Once you have done that, you can decide for yourself if you still want to bundle the libs with your addon, or have the users install them separately. Having them installed separately will cause less problems in the future (in case another addon is depending on a newer version of the lib, but doesn't have it bundled) and you won't have to update the bundled libs yourself any more. It also has slightly better performance (less folders to scan for the game), but that's likely only in the ms-range.

Enodoc 05/27/19 08:41 AM

Quote:

Originally Posted by sirinsidiator (Post 38191)
As an author, you switch away from the LibStub embedded way of adding source files to your own manifest. Instead you should use DependsOn for libraries that have to be loaded and OptionalDependsOn for libs that may be loaded. In any case you will have to check the library if it has been updated to support this.

Once you have done that, you can decide for yourself if you still want to bundle the libs with your addon, or have the users install them separately. Having them installed separately will cause less problems in the future (in case another addon is depending on a newer version of the lib, but doesn't have it bundled) and you won't have to update the bundled libs yourself any more. It also has slightly better performance (less folders to scan for the game), but that's likely only in the ms-range.

OK cool thanks. So just to check that I understand correctly - in terms of LAM, which is obviously the primary example that I know has already been updated:

The library in question needs to have its own manifest txt file, which must include:
Code:

## IsLibrary: true

The individual add-on's manifest txt file needs to change from:
Code:

## OptionalDependsOn: LibStub LibAddonMenu-2.0

Libs/LibStub/LibStub.lua
Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
Libs/LibAddonMenu-2.0/controls/panel.lua
...

AddOn.lua

to:
Code:

## DependsOn: LibAddonMenu-2.0

AddOn.lua


And the add-on code itself needs to change from:
lua Code:
  1. local LAM = LibStub("LibAddonMenu-2.0")

to:
lua Code:
  1. local LAM = LibAddonMenu-2.0

Then the library could or could not be bundled in the add-on directory, and the game will load it from the add-on or from standalone depending on which is the most recent version.

Is that everything in summary? Thanks!

sirinsidiator 05/27/19 08:58 AM

Quote:

Originally Posted by Enodoc (Post 38209)
Is that everything in summary? Thanks!

That's mostly correct.
The IsLibrary flag is actually just so the game knows that it has to show it in the library list on the bottom of the addon menu. The more important thing is to specify an AddOnVersion. Otherwise the game cannot know which version is the newest one in case there are several copies present.
And the global variable is just "LibAddonMenu2" and not "LibAddonMenu-2.0", since Lua would interpret that as "nil - 2" and throw an error. ;)


All times are GMT -6. The time now is 11:45 AM.

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