Mercurial > wow > dependencyloader
comparison DependencyLoader/bootstrap.lua @ 0:9852fcd5e59e
initial import
| author | mckenziemc |
|---|---|
| date | Tue, 30 Nov 2010 16:13:04 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:9852fcd5e59e |
|---|---|
| 1 -- bootstrap.lua | |
| 2 -- Bootstrap code for DependencyLoader, allowing | |
| 3 -- the user to successfully load it without | |
| 4 -- explicitly enabling its own dependencies. | |
| 5 | |
| 6 | |
| 7 local addonName, addonTable = ... | |
| 8 | |
| 9 -- TODO: move and use dependency parsing function here? | |
| 10 local dependencies = {"LibStub", "LibPrint-1.0", "Ace3"} | |
| 11 | |
| 12 local canLoad = true | |
| 13 for _, addon in pairs(dependencies) do | |
| 14 local reason = select(6, GetAddOnInfo(addon)) | |
| 15 | |
| 16 if reason ~= nil and reason ~= "DISABLED" then | |
| 17 canLoad = false | |
| 18 break | |
| 19 end | |
| 20 end | |
| 21 | |
| 22 if not canLoad then | |
| 23 print("Can't load DependencyLoader") | |
| 24 return | |
| 25 end | |
| 26 | |
| 27 | |
| 28 print("Loading DependencyLoader") | |
| 29 | |
| 30 for _, addon in pairs(dependencies) do | |
| 31 EnableAddOn(addon) | |
| 32 end | |
| 33 | |
| 34 EnableAddOn("DependencyLoader_Core") | |
| 35 LoadAddOn("DependencyLoader_Core") | |
| 36 |
