Without LibStub
So I have been investigating why when there are three mods all using CustomCompassPins that they only work when all three mods are using the same file. What I am learning from Shinni is that one of the three libraries is going to load first. So take this scenario. I have 1.14, 1.17, and 1.19 in the three mods. If 1.17 load first then it defines the routines. When 1.19 loads it redefines, updates, or changes the functions. There is a routine to check for the version number that does not use LibStub and when 1.14 loads last it won't load at all because 1.17 and 1.19 are newer versions.
With LibStub
1.17 still loads before 1.19, then 1.19 loads and then 1.14 does not load.
Question:
Lua Code:
local MAJOR, MINOR = "CustomCompassPins-1.0", 4
local CustomCompassPins, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not CustomCompassPins then return end --the same or newer version of this lib is already loaded into memory
So when I have a ,4 ,7 and ,9 doesn't that make 9 the newest file?
When using that syntax why wouldn't it say I have three known versions of the same library so I am only going to load the newest one. Stopping 1.14 and 1.17 from loading at all even if they tried to load before 1.19. Can LibStub do that? Can LibStub catalog all the versions of the libraries prior to loading them and then decide which one to use?