view DependencyLoader/bootstrap.lua @ 8:930871e163bc

created a new Tree class and started rearranging code
author mckenziemc
date Sat, 04 Dec 2010 23:05:34 -0800
parents 9852fcd5e59e
children
line wrap: on
line source
--	bootstrap.lua
--	Bootstrap code for DependencyLoader, allowing 
--	the user to successfully load it without 
--	explicitly enabling its own dependencies.


local addonName, addonTable = ...

--	TODO: move and use dependency parsing function here?
local dependencies = {"LibStub", "LibPrint-1.0", "Ace3"}

local canLoad = true
for _, addon in pairs(dependencies) do
	local reason = select(6, GetAddOnInfo(addon))
	
	if reason ~= nil and reason ~= "DISABLED" then
		canLoad = false
		break
	end
end

if not canLoad then
	print("Can't load DependencyLoader")
	return
end


print("Loading DependencyLoader")

for _, addon in pairs(dependencies) do
	EnableAddOn(addon)
end

EnableAddOn("DependencyLoader_Core")
LoadAddOn("DependencyLoader_Core")