View Single Post
10/22/19, 09:15 AM   #7
Anceane
 
Anceane's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 306
Originally Posted by Baertram View Post
Code:
local version = 7.2
local LibHarvensAddonSettings = LibStub:NewLibrary("LibHarvensAddonSettings-1.0", version)
if not LibHarvensAddonSettings then return end
This means:
LibStub:NewLibrary will create the library with unique name LibHarvensAddonSettings-1.0, and version 7.2.
Any other addon trying to use the same lib will also use LibStub and it will notice there already is version 7.2 with that unqiue name loaded. If no newer version will be found (like 7.3 or 8 or higher) it will just do nothing within LibStub.
If a higher evrsion is found it will laod this then as "newest".


It's basically the same like the new ## AddOnVersion: <integer value> tag in the txt files of libraries/addons does. The ingame addonmanager will check these tags and if there are multiple "folders"/"txt files in folders" (they normally need to have the same name!) with the same name, then it will only load the highest unsigned integer value file.


In the end you got a table of data which is locally defined in the file and called "LibHarvensAddonSettings".
-> local LibHarvensAddonSettings = LibStub:NewLibrary...

Not sure what you tried but if the library LibStub is activated and LibStub is added as ## DependsOn: LibStub inside the LibHarvensAddonSettings.txt file, it should load LibStub properly before this lib and then be able to load this complete library LibHarvensAddonSettings as well.

What I meant is:
If you say the libraries are shown outdated and you need to enable the checkbox "Allow out of date addons" ingame, why don't you change the txt files of the shown outdated libraries/Addons and just increase the
## APIVersion: to 100029, like this:
Code:
## APIVersion: 100029 100030
And then they are not oudated anymore
Oh that i did. But yet it says that i need to find a library that match the actual game version.

Code:
## Title: Harven's Addon Settings
## Description: Library to add your addon settings to the common settings page. The functionality is similar to great Seerah's LibAddonMenu addon but it's written from scratch.
## APIVersion: 100029 100030
## AddOnVersion: 10702
## IsLibrary: true
## OptionalDependsOn: LibStub

LibHarvensAddonSettings.lua
This bolded part is what i changed. But for a reason that do not work at all.
  Reply With Quote