annotate Libs/LibStub/LibStub.lua @ 3:c6f0976069c7
Default value for the welcome / bye notification is now set to false
The mailframe checkbox now primarily toggles the mail opening, however if you hold shift you can still disable the entire addon
Now properly removes QuickAuction?s mail count
Now tracks when a mail lost all attachments rather than it being deleted in order to continue processing the next item (mail sent by players containing text should now work properly). This should also be good for a nice speed increase.
Added a variable called ?busy? to the MailOpener object indicating whether or not Mail Opener is currently working. Other addons (or macros) can retrieve it with ?LibStub("AceAddon-3.0"):GetAddon("MailOpener").busy?
A mail refresh from the Postal service should no longer occur while mail is being opened but will happen instantly afterwards.
Postal?s module toggling will now be handled by Postal itself.
Added a short summary to the top of all modules for other developers.
The time remaining until next mail box refresh should be displayed for as long as Mail Opener can be sure.
| author |
Zerotorescue |
| date |
Tue, 07 Sep 2010 17:46:27 +0200 |
| parents |
823e33465b6e |
| children |
|
| rev |
line source |
|
Zerotorescue@0
|
1 -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
|
|
Zerotorescue@0
|
2 -- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
|
|
Zerotorescue@0
|
3 local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
|
|
Zerotorescue@0
|
4 local LibStub = _G[LIBSTUB_MAJOR]
|
|
Zerotorescue@0
|
5
|
|
Zerotorescue@0
|
6 if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
|
Zerotorescue@0
|
7 LibStub = LibStub or {libs = {}, minors = {} }
|
|
Zerotorescue@0
|
8 _G[LIBSTUB_MAJOR] = LibStub
|
|
Zerotorescue@0
|
9 LibStub.minor = LIBSTUB_MINOR
|
|
Zerotorescue@0
|
10
|
|
Zerotorescue@0
|
11 function LibStub:NewLibrary(major, minor)
|
|
Zerotorescue@0
|
12 assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
|
|
Zerotorescue@0
|
13 minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
|
|
Zerotorescue@0
|
14
|
|
Zerotorescue@0
|
15 local oldminor = self.minors[major]
|
|
Zerotorescue@0
|
16 if oldminor and oldminor >= minor then return nil end
|
|
Zerotorescue@0
|
17 self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
|
Zerotorescue@0
|
18 return self.libs[major], oldminor
|
|
Zerotorescue@0
|
19 end
|
|
Zerotorescue@0
|
20
|
|
Zerotorescue@0
|
21 function LibStub:GetLibrary(major, silent)
|
|
Zerotorescue@0
|
22 if not self.libs[major] and not silent then
|
|
Zerotorescue@0
|
23 error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
|
|
Zerotorescue@0
|
24 end
|
|
Zerotorescue@0
|
25 return self.libs[major], self.minors[major]
|
|
Zerotorescue@0
|
26 end
|
|
Zerotorescue@0
|
27
|
|
Zerotorescue@0
|
28 function LibStub:IterateLibraries() return pairs(self.libs) end
|
|
Zerotorescue@0
|
29 setmetatable(LibStub, { __call = LibStub.GetLibrary })
|
|
Zerotorescue@0
|
30 end
|