Thread Tools Display Modes
Prev Previous Post   Next Post Next
05/16/14, 02:42 PM   #1
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 670
LibStub and Libraries loading First

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:
  1. local MAJOR, MINOR = "CustomCompassPins-1.0", 4
  2. local CustomCompassPins, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
  3. 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?
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » LibStub and Libraries loading First


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