View Single Post
06/22/20, 03:32 AM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
Originally Posted by NaterOfTheWired View Post
Technically this is not an issue with LibAddonMenu-2.0, but with the removal of the embedded LibStub which broke Wykkyd's Toolbar, DarkUI, PointsOfColor, and ConspicuousQuestMarkers. Nothing to do on this end I dont think. Those authors just need to update their addons to remove LibStub properly.
Afaik LAM2 will also still work with LibStub installed, if there are addons using embedded older versions e.g. (which should have been patched and fixed since years already).
But the removal of LibStub in total was communicated since Summerset patch, >2 years ago now.

These addons just need to:
1. switch from these kind of source lines:
Code:
local lam = LibStub("LibAddonMenu-2.0")
to this one:
Lua Code:
  1. local lam = LibAddonMenu2
2. Delete ALL included OLD library folders in subfolders, or inside the addon's folder, like "libs", "Libraries", etc. where these libraries were included without their own txt files!
If the librray does not exist with it's own txt file it can be kept inside there.
But if it's a real library, meant to be reused in several addons, it should be release WITH a txt file, or the code should be maybe not in a library but directly in the addon's lua files.
3. Inside the addon's txt files the hardcoded lines to the libraries, which were removed from the subfolders, need to be removed.
e.g.
Code:
/libs/LibAddonMenu-2.0/LibAddonMenu-2.0/controls/editbox.lua
/libs/LibAddonMenu-2.0/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
4. In the txt file of the addon use the tags
## DependsOn: <libraryName1> <libraryName2>>=<libraryVersion>
or
## OptionalDependsOn: <libraryName1> <libraryName2>>=<libraryVersion>
to define if the addon will not load without the librray (and version) installed (## DependsOn)
or if the addon will load without the librray (and version) installed, but it optionally will load the libs first (if found!).

<libraryName1> = the name of the library's txt file or foldername
if >= is specified after the libraryname a "version check" will be done. Only libs with this, or a higher version, will be loaded!
<libraryVersion> = the integer number from the library's txt file's tag ## AddOnVersion: <integerNumber>

So e.g. use
Code:
## DependsOn: LibAddonMenu-2.0>=31
will tell your addon to load only if the LAM2.0 version r31 was installed and activated.
5. You may also download the complete library, including their txt file, and put them extracted to the subfolder "libs" of your addon. This will make the addon manager find the txt files in there and check if your version is the newest one to load. But including them without txt files or even ALWAYS load them hardcoded from your addon's txt file will most probably create errors and problems. So freain from using this way of library loading where NOT NEEDED (e.g. lib does not provide a txt file [yet]).


Additional info for lua addon developers, regarding included libraries:
https://www.esoui.com/forums/showthread.php?t=8765

Additonal library/dependency information can be found here:
https://wiki.esoui.com/Libraries
https://www.esoui.com/forums/showthread.php?t=9149

Last edited by Baertram : 06/22/20 at 07:16 AM.