Allow overwriting for addons loaded twice (BrokerPack)
This commit is contained in:
parent
faf15b09f1
commit
4469d04afe
|
@ -1,4 +1,4 @@
|
||||||
local lib = LibStub:NewLibrary("zzAddOn", 6)
|
local lib = LibStub:NewLibrary("zzAddOn", 7)
|
||||||
if not lib then return end
|
if not lib then return end
|
||||||
local config = LibStub:GetLibrary("zzConfig")
|
local config = LibStub:GetLibrary("zzConfig")
|
||||||
lib['callbacks'] = lib['callbacks'] or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib)
|
lib['callbacks'] = lib['callbacks'] or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib)
|
||||||
|
@ -88,7 +88,7 @@ end
|
||||||
function lib:NewAddOn(addonName, addonTable)
|
function lib:NewAddOn(addonName, addonTable)
|
||||||
local specs = self['specs']
|
local specs = self['specs']
|
||||||
local childName = specs['name']
|
local childName = specs['name']
|
||||||
if(lib['addons'][childName]) then
|
--[[ if(lib['addons'][childName]) then
|
||||||
local oldchild = lib['addons'][childName]
|
local oldchild = lib['addons'][childName]
|
||||||
local parent = oldchild:GetParent()
|
local parent = oldchild:GetParent()
|
||||||
if(parent) then
|
if(parent) then
|
||||||
|
@ -97,7 +97,7 @@ function lib:NewAddOn(addonName, addonTable)
|
||||||
errormsg(format("|%s already loaded", childName))
|
errormsg(format("|%s already loaded", childName))
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end ]]
|
||||||
if(type(childName) == 'string') then
|
if(type(childName) == 'string') then
|
||||||
self.GetAddOnTable = function() return addonTable end
|
self.GetAddOnTable = function() return addonTable end
|
||||||
lib['addons'][childName] = self
|
lib['addons'][childName] = self
|
||||||
|
|
Loading…
Reference in New Issue