mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
fix #54 LunaUnitFrames
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
|
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
|
||||||
local LibStub = _G[LIBSTUB_MAJOR]
|
local LibStub = _G[LIBSTUB_MAJOR]
|
||||||
|
|
||||||
|
local find, format = string.find, string.format
|
||||||
|
|
||||||
-- Check to see is this version of the stub is obsolete
|
-- Check to see is this version of the stub is obsolete
|
||||||
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
||||||
LibStub = LibStub or {libs = {}, minors = {} }
|
LibStub = LibStub or {libs = {}, minors = {} }
|
||||||
@@ -19,7 +21,8 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
|||||||
-- returns empty library object or old library object if upgrade is needed
|
-- returns empty library object or old library object if upgrade is needed
|
||||||
function LibStub:NewLibrary(major, minor)
|
function LibStub:NewLibrary(major, minor)
|
||||||
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
|
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
|
||||||
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
|
local _, _, num = find(minor, "(%d+)")
|
||||||
|
minor = assert(tonumber(num), "Minor version must either be a number or contain a number.")
|
||||||
|
|
||||||
local oldminor = self.minors[major]
|
local oldminor = self.minors[major]
|
||||||
if oldminor and oldminor >= minor then return nil end
|
if oldminor and oldminor >= minor then return nil end
|
||||||
@@ -35,7 +38,7 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
|||||||
-- returns the library object if found
|
-- returns the library object if found
|
||||||
function LibStub:GetLibrary(major, silent)
|
function LibStub:GetLibrary(major, silent)
|
||||||
if not self.libs[major] and not silent then
|
if not self.libs[major] and not silent then
|
||||||
error(string.format("Cannot find a library instance of %q.", tostring(major)), 2)
|
error(format("Cannot find a library instance of %q.", tostring(major)), 2)
|
||||||
end
|
end
|
||||||
return self.libs[major], self.minors[major]
|
return self.libs[major], self.minors[major]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
-- $Id: LibStub.lua 103 2014-10-16 03:02:50Z mikk $
|
-- $Id: LibStub.lua 103 2014-10-16 03:02:50Z mikk $
|
||||||
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/addons/libstub/ for more info
|
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/addons/libstub/ for more info
|
||||||
-- LibStub is hereby placed in the Public Domain
|
-- LibStub is hereby placed in the Public Domain
|
||||||
-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
|
-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
|
||||||
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
|
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
|
||||||
local LibStub = _G[LIBSTUB_MAJOR]
|
local LibStub = _G[LIBSTUB_MAJOR]
|
||||||
|
|
||||||
local find, format = string.find, string.format
|
local find, format = string.find, string.format
|
||||||
@@ -51,4 +51,4 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
|||||||
end
|
end
|
||||||
|
|
||||||
setmetatable(LibStub, { __call = LibStub.GetLibrary })
|
setmetatable(LibStub, { __call = LibStub.GetLibrary })
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user