Mercurial > wow > dependencyloader
diff DependencyLoader/Addon.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/Addon.lua Sat Dec 11 03:32:04 2010 -0800 +++ b/DependencyLoader/Addon.lua Tue Dec 21 00:23:57 2010 -0800 @@ -5,6 +5,8 @@ local addonName, addonTable = ... +local debug = addonTable.debug + -- TODO: test if the API functions are quicker with indexes than names. -- TODO: modify the dependency stuff to check the Errata module. @@ -161,6 +163,12 @@ end +function addon:CanLoadLate() + -- TODO: check Errata module + return false +end + + -- can this addon be force-loaded after the point where the client would enable it? function addon:CanForceLoadAfter() -- TODO: check Errata module @@ -184,9 +192,9 @@ function addon:Enable() if IsLoggedIn() then + addonTable.classes.Core:RawEnableAddOn(self.name) + else addonTable.classes.Core:QueueEnable(self.name) - else - addonTable.classes.Core:RawEnableAddOn(self.name) end end @@ -200,7 +208,15 @@ end +function addon:LoadLate() + classes.Core:RawEnableAddOn(self.name) + classes.Core:RawLoadAddOn(self.name) +end + + function addon:ForceLoad() + debug("addon:ForceLoad called on", self.name) + assert(self:CanForceLoad()) -- TODO: make sure force-loading is available at this time