Go to Page... |
|
Thread Tools | Display Modes |
|
09/22/19, 07:48 PM | #1 |
Please do NOT include libraries without own txt file (where possible)
Information for addon developers
Hello devs, I often find addons here on esoui which include libraries in a subfolder (like /libs). This is common and no problem as long as you include the libraries with their own txt file (if they got one)! If the library got no own txt file you could check if you can add one and publish the library as standalone here on esoui.com. If this is not possible or the lib is only used in your few addons, you can include and load them from your addon's txt file. If you just load them from your addon's txt file without adding them to your addon's txt ## OptionalDependsOn: or ## DependsOn: they will most likely break one day. -More information about the libraries and the included libs can be read here- So if you include the libraries please do the following:
This will assure that only the newest version of the library wil lbe loaded ingame. And it will help to reduce errors because of "hardcoded calls to outdated libraries". LibStub is obsolete: LibStub will be gone one day as the ## AddOnVersion: tag can be used since the Summerset patch already. Most libraries work without, and still with LibStub already. Some were changed to only support their own global variable and NOT LibStub anymore (e.g. the wide spread addon menu library "LibAddonMenu-2.0" was just changed to strip LibStub). Please check your addons on next update if you can replace calls to LibStub from e.g. Code:
local LAM = LibStub("LibAddonMenu-2.0") Code:
local LAM = LibAddonMenu2>=28 Version check for needed dependencies: The >= means "only allow versions equal or newer to". 28 was the version where the global LibAddonMenu2 variable was added to the librray. The version number can be found inside the libraries' own txt file, tag ## AddOnVersion: <integerVersionNumber> This >= can be used at the ## DependsOn: and the ## OptionalDependsOn: tags. Information for addon users What if my addon is very outdated and noone will update it anymore? I'd first search for a working replacement. Or ask someone to fix the addon for you. Or you can try to fix it yourself. Search the folder and subfolder of the addon for "libs" or "libraries" or any similar folders. In there there might be used dependencies/libraries, but without an own txt file of that library. I'd do the following: Make a list of the libraries in the subfolder "libs"/"libraries" or similar. Then move ALL subfolders in this "libs"/"libraries" folder away, totally outside of your elder scrolls/live/addons folder (e.g. to c:\backup). Check the name of the libraries that were included into the addon and search them at www.esoui.com, download the newest version. Install it into your AddOns folder directly/via Minion. Once installed check if the library installed to your AddOns folder got an own txt file, e.g. LibAddonMenu-2.0.txt. If so: All is fine, the addon manager will find them there. If not: Copy this library into the addon's same subfolder (e.g. "libs") where it was before, in order to have the newest version. Afterwards do for each library which you have checked, removed, reinstalled/updated like above: If the library got it's own txt file: Search the txt file of the "addon" (not the libraries!!!) for these entries ## DependsOn: <libraryName1> <libraryName2> or ## OptionalDependsOn: <libraryName1> <libraryName2> <addonName1> Copy & paste the filename of the libraries' txt file, without the .txt extension (e.g. "LibAddonMenu-2.0.txt" -> Copy "LibAddonMenu-2.0") to the ## DependsOn: line, at the end, after existing entries, sperated via a SPACE. e.g. line was before: ## DependsOn: LibFilters-3.0 Line after your update: ## DependsOn: LibFilters-3.0 LibAddonMenu-2.0>=31 The >= is mentioned and described above (at "Information for addon developers" -> "Version check for needed dependencies") and is different for EACH library, so check these libraries txt files for the most up2date ## AddOnVersion tag, to be sure you add the correct numbers. Or do not use the >= integer addition at all. If the ## DependsOn: line already included the same library name you do not need to add it again! After that check the txt file of the AddOn (not the libraries!!!) for "hardcoded library lines" with the same library name you have just added as ## DependsOn (in our example LibAddonMenu-2.0). They look like this: /libs/LibAddonMenu-2.0/controls/editbox.lua or /libs/LibAddonMenu-2.0/LibAddonMenu-2.0/LibAddonMenu-2.0.lua Remove ALL the hardcoded lines of the libraries that were just added to the ## DependsOn or ## OptionalDependsOn! The ## DependsOn or ## OptionalDependsOn willa ssure the ZOs addon manager ingame will find the libraries via their own txt files properly, AND will only load the bewest version (via the ## AddOnVersion: tag) once. Exception: If the library does not provide it's own txt file, the addon manager ingame won't be able find them. This is why some of the libs need to be loaded via these "hardcoded lines" from the addon's txt file. So leave the lines in/untouched for the libraries you have found/updated before, where there is no own txt file in the libraries' folder! Or maybe ask the library author to update and release a version WITh it's own txt file (would be best imo). For more library related technical information you can read this WIKI entry: https://wiki.esoui.com/Libraries Last edited by Baertram : 03/14/21 at 12:50 PM. |
|
09/23/19, 10:17 AM | #2 |
When i have this in a configmenu.lua, do i need to change it too ? (i corrected the .txt, the call in in the main lua, but i dont know about this one part
Code:
local LAM = LibStub( 'LibAddonMenu-2.0', true ) local LMP = LibStub( 'LibMediaProvider-1.0', true ) if ( not LAM ) then return end if ( not LMP ) then return end My basic understanding would be to do : Code:
local LAM = LibAddonMenu-2.0 local LMP = LibMediaProvider-1.0 if ( not LAM ) then return end if ( not LMP ) then return end |
|
09/23/19, 12:10 PM | #3 |
|
For LAM: look at how Baertram did it. You almost had it correct.
For LMP: no, it hasn't been setup to work without LibStub. |
09/24/19, 01:56 AM | #4 | |
Best is probably to wait for Authors to decide what they want to do first with Libstub And btw, the addon i wanted to check is a very old one : https://www.esoui.com/downloads/info...dandjpFix.html This is actually my principal addon, without it i would not be able to read correctly the game |
||
09/24/19, 06:56 AM | #5 | |
LibStub is still working and some libraries are still not changed to work without it.
So you can prepare addons and libs to not use LibStub anymore where applicable, or what until it's gone and let them fail to load properly then. Currently it's only an advice to make addons work with or without it. You can even load the library via LibStub as long as it is given and if LibStub == nil then use the global variable instead (hybrid solution).
|
||
09/25/19, 09:22 AM | #6 | |
Code:
local LMP = LibMediaProvider if not LMP then return end |
||
ESOUI » Developer Discussions » General Authoring Discussion » Please do NOT include libraries without own txt file (where possible) |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|