view DependencyLoader_Bootstrap/bootstrap.lua @ 15:a46bf694050c

cleaned up Tree's methods a bit and improved documentation Addon:Exists will now return false for Blizzard addons (needs to be handled better) Addon.lua will now use the raw hooks from the interface module fixed the inverted returns from IsForceLoadAvailable EnableAddOn and LoadAddOn hooks will now skip the extra processing if the addon does not exist or is a Blizzard addon moved the EnableAddOn queing to the interface
author mckenziemc
date Sat, 11 Dec 2010 01:48:39 -0800
parents b230b94d4487
children e7995d599184
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 = ...


--	FIXME: don't force-load if we're already logged in


print("loading DependencyLoader_Bootstrap")

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

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

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


print("bootstrap: Loading DependencyLoader")

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

EnableAddOn("DependencyLoader")
LoadAddOn("DependencyLoader")