03/12/14, 03:30 PM | #1 | |
Join Date: Mar 2014
Posts: 16
|
What is LibStub?
Hey All,
I've read the little document on LibStub here, but it doesn't clarify to me at all what it is or what it does. What exactly is a "versioning library" in terms of add-ons? What is a library in general in terms of add-ons? I see this in add-ons all the time: Code:
local LAM = LibStub("LibAddonMenu-1.0") What are majors and minors? What does LibAddonMenu-1.0.lua do? It looks like a bunch of functions for creating windows? Lastly, what is a stub? Sorry for all these questions. Can't seem to find any documentation anywhere other than what I linked, which only helps if you already know what it's doing (from WoW or something). |
|
03/12/14, 05:27 PM | #2 | |
Join Date: Mar 2014
Posts: 3
|
Basically it a group or compilation of scripts and/or code that can be used as the basis for add ons.
You use so that your mods function with other mods, you use it so that it is easier to get started, and similar stuff. Think of it as a dll or dynamic link library for lua. |
|
vasdrakken |
View Public Profile |
Find More Posts by vasdrakken |
03/13/14, 10:44 AM | #3 | |
Join Date: Mar 2014
Posts: 16
|
What is LibStub?
Hi All,
I asked the question "What is LibStub?" in the wrong forum on accident. Since I asked that question, I went and did some research and actually figured it out myself. I'd like to post here my findings/conclusions so that it may help other people who have the same question I did. If you see anything wrong here, please feel free to correct me. The following block of code is the exact code of LibStub.lua with detailed explanations of everything that is happening. I use the addon "LibAddonMenu-1.0" as an example throughout these explanations...thanks to Seerah for unknowingly allowing me to use his addon as an example Lua Code:
If you have any questions please feel free to ask! Last edited by inDef : 03/13/14 at 10:56 AM. |
|
03/13/14, 11:14 AM | #4 | |
Join Date: Mar 2014
Posts: 16
|
Thanks to mods for moving!
|
|
03/13/14, 11:49 AM | #5 |
You're welcome. I just merged the two threads, since there was some information in one that wasn't in the other and vice versa. Figured that'd work best.
|
|
03/13/14, 02:32 PM | #6 |
Sorry, inDef, I was travelling and wanted to give you the answer and time needed, rather than try to get something out quick on my phone.
Glad you were able to find the answers you were looking for, and thanks so much for posting it here for others as well! /edit: I would like to point out also that in the top of your library code, you should do this: Lua Code:
Last edited by Seerah : 03/13/14 at 02:41 PM. |
|
03/13/14, 08:31 PM | #7 | ||
Join Date: Mar 2014
Posts: 16
|
Yeah, after I realized I posted in the wrong place and it'd likely be awhile before getting the response I was looking for... I decided to just dive in and figure it out. Learned a lot and my understanding is much better now for it. I wish ESO was out so I could start working on my addon! Or if ZOS would at least give you guys permission to post the default UI functions and what they do (the ZO_ ones). |
||
ESOUI » Developer Discussions » General Authoring Discussion » What is LibStub? |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|