diff DependencyLoader/Core.lua @ 18:e7995d599184 tip

updated pkgmeta fix the inversion in addon:Enable added support for late-loading
author mckenziemc
date Tue, 21 Dec 2010 00:23:57 -0800
parents f825ccf94a89
children
line wrap: on
line diff
--- a/DependencyLoader/Core.lua	Sat Dec 11 03:32:04 2010 -0800
+++ b/DependencyLoader/Core.lua	Tue Dec 21 00:23:57 2010 -0800
@@ -48,6 +48,13 @@
 end
 
 
+function Core:CanLoadLate()
+	--	assume we've already logged in
+	return true
+	--	TODO: check user settings
+end
+
+
 --	Enables any dependencies needed by the addons 
 --	that have already been enabled
 function Core:PrepareAllAddons()
@@ -104,6 +111,8 @@
 			--	else
 			--	it can't be loaded, maybe tell the user
 			
+			debug("EnableAddOn hook, checking", addon:GetName())
+			
 			if tree:CanForceLoad() then
 				if addon:CanLoD() then
 					tree:PrepareForLoD()
@@ -144,6 +153,8 @@
 			if tree:CanLoD() then
 				tree:PrepareForLoad()
 				--	don't actually intend to reload, just enable everything
+			elseif self:CanLoadLate() and tree:CanLoadLate() then
+				tree:LoadLate()
 			elseif tree:CanLoad() then
 				tree:PrepareForLoad()
 				requestReload = true
@@ -201,6 +212,7 @@
 
 
 function Core:RawEnableAddOn(...)
+	debug("RawEnableAddOn: enabling", ...)
 	return self.hooks.EnableAddOn(...)
 end