Quantcast
Reviving addons - What is to check/change - ESOUI
Thread Tools Display Modes
11/14/21, 05:01 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 3,817
Reviving addons - What is to check/change

This thread is not about removing lua error messages! Most errors will be fixed if you clean up the included libraries (see below) and update the versioning. You need to find and fix lua error messages yourself please as they differ per addon!

Remove included libraries where possible
Existing older addons often include libraries in their subfolders which were shipped with the addons in the past. This changed and the libs are installed like addons to live/AddOns once (at leats most) so that you only got 1 single point of error possibility and 1 single point to update (e.g. via Minion, just like normal AddOns too).

So please check if the addon you want to fix/revive includes libraries in subfolders, often the foldername is "libs". If the libs in there are included without a txt file of that library, and if this library is available at www.esoui.com/Minion for download: Remove the whole library's folder in that addon!
Add the library's name to the txt file of your addon you are fixing, e.g.
Code:
## DependsOn: LibAddonMenu-2.0
or if it's an optional library:
Code:
## OptionalDependsOn: LibWhatEver1 LibWhatever2 LibWhatever3
You can name as many libs/other addons, also using the versioning suffix >=<unsignedIntegerForTheirVersion>, as you want in the (Optional)DependsOn tag BUT you can only specify up to 200 characters in 1 line! So if your line is longer split it up into multiple ## DependsOn or ## OptionalDepenndsOn lines!


Remove LibStub and it's calls
Remove the library LibStub from your addon's subfolder/folders. It's obsolete and should not be used anymore. Read more about it here;
https://wiki.esoui.com/Libraries#Lib...ersion_control

In your addon's code remove all lines with LibStub and use the global variables of the libraries now. e.g. instea of LibStub("LibAddonMenu-2.0") use LibAddonMenu2 now.
The global variable names of the libs are mentioned in the libraries' descriptions/changelog/Github Wiki/Documentation/source code and often are using the same name as the library does. e.g. LibDialog, LibSets but f there are numbers in the lib's name you often need to be carefull e..g LibAddonMenu2 (->name is "LibAddonMenu-2.0"), LibFilters3 (->name is "LibFilters-3.0")


AddOn/Library versioning
If you add libraries/addons to the (Optional)DependsOn lines please also check if the libs/AddOns got a special version you need to make sure is loaded in order to be able to use that lib's global variables!
e.g. LibAddonMenu-2.0 introduced the global LibAddonMenu2 with version 28 first!
So you should, for new/reviced addons, add the >=28 to the end of the line:
Else some users may have an older version installed, the game thinks everything is alright but it still throws errors then!

Code:
## DependsOn: LibAddonMenu-2.0>=28
If there are already newer versions released you definately should, at least for new/updated addons, use the most current version (32 in this case of LAM2.0 as of 2021-11-13)!
The version is writtten in the lib/Addon's txt (manifest) file, tag
Code:
## AddOnVersion: <unsignedInteger>
Lib versioning and why it is important (as LibSub is not used anymore) is described here:
https://wiki.esoui.com/Libraries#Library_versioning


Your addon's new txt "manifest" file
As described above make sure to add the new needed ## OptionalDependsOn / ## DependsOn for the libraries that are not included anymore.
The ## Version: tag is ONLY used for Minion/ESOUI and is not an official versioning of ESO! So please add the new tag
Code:
## AddOnVersion: <unsignedInteger>
in order to specify the version of your addon (especially if it's a library! If it's a lib add the ## IsLibrary: true tag for sure!).
Update the ## APIVersion: tag with the proper api version. You can get the number by using
Code:
/script d(GetAPIVersion())
ingame in the chat editbox, and press the return key.
## APIVersion: can handle 2 apiversions after each other, not more! So this won't work: ## APIVersion: 101032 101033 101034
Make sure that hardcoded lines to the libs that were included in subfolders, e.g. "/libs/LibAddonMenu-2.0" will be removed!
e.g. if you have removed the libs in subfolders, and updated the ## DependsOn so that the addon needs the lib from e.g. the "live/AddOns" folder (using the lib's own txt file to be detected properly!) also remove all pointng lines from your manifest txt, like these:
Code:
/libs/LibAddonMenu-2.0/controls/editbox.lua
/libs/LibAddonMenu-2.0/controls/dropdown.lua
...
/libs/LibAddonMenu-2.0/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
ONLY KEEP THE LINES of libraries which do not provide their own txt file or were not released on www.esoui.com! Some older libs never made it here but still work. So you need to hardcode their call to their .lua files in the manifest txt of your addon AND include the library files with your addon then


Check and change SavedVariables (e.g. Multi server support / use rename safe characterIds instead of names)
Also think about the SavedVariables please if you revive addons. If there is no need to mifrate them from old ones or if the version of SV increases and they are reset, please use the GetWorldName() function and use it in ZO_SavedVars parameter for "profile" e.g. to distinguish the settings for different ESO servers (NA Megaserver, EU Megaserver, PTS).
And if addons still use ZO_SavedVars:NewCharacterNameSettings or ZO_SavedVars:New (will use the same cahracter names!) change it to ZO_SavedVars:NewCharacterIdSettings please so the SV are saved with the server's characerId -> rename safe!

Here you can see what the "profile" parameter is:
Code:
ZO_SavedVars:NewAccountWide(savedVariableTable, version, namespace, defaults, profile, displayName)
--displayName could be used to overwrite your currently logged in @accountName! You can specify something like "AllAccountsSaveTheSame" to --save it all teh same for all acounts e.g.!
ZO_SavedVars:NewCharacterIdSettings(savedVariableTable, version, namespace, defaults, profile)

Your addon's new description at www.esoui.com
Update the addon's description with the libraries (dependencies) needed, at best: at the top so that all users are able to read it directly and within the Minion UI properly!
If you are not a team member of the addon, and cannot officially update it, read here please https://www.esoui.com/forums/showthread.php?t=9865 at the section "If you request an addon fix/update/revive"

Last edited by Baertram : 11/14/21 at 05:22 PM.
 

ESOUI » Developer Discussions » Lua/XML Help » Reviving addons - What is to check/change

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off