vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --[[
2 Name: AceAddon-2.0
3 Revision: $Rev: 4588 $
4 Author(s): ckknight (ckknight@gmail.com)
5 Inspired By: Ace 1.x by Turan (<email here>)
6 Website: http://www.wowace.com/
7 Documentation: http://wiki.wowace.com/index.php/AceAddon-2.0
8 SVN: http://svn.wowace.com/root/trunk/Ace2/AceAddon-2.0
9 Description: Base for all Ace addons to inherit from.
10 Dependencies: AceLibrary, AceOO-2.0, AceEvent-2.0, (optional) AceConsole-2.0
11 ]]
12  
13 local MAJOR_VERSION = "AceAddon-2.0"
14 local MINOR_VERSION = "$Revision: 4588 $"
15  
16 -- This ensures the code is only executed if the libary doesn't already exist, or is a newer version
17 if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
18 if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
19  
20 if not AceLibrary:HasInstance("AceOO-2.0") then error(MAJOR_VERSION .. " requires AceOO-2.0.") end
21  
22 -- Localization
23 local STANDBY, TITLE, NOTES, VERSION, AUTHOR, DATE, CATEGORY, EMAIL, WEBSITE, CATEGORIES, ABOUT, PRINT_ADDON_INFO
24 if false then -- GetLocale() == "deDE"
25 else -- enUS
26 STANDBY = "|cffff5050(standby)|r"
27  
28 TITLE = "Title"
29 NOTES = "Notes"
30 VERSION = "Version"
31 AUTHOR = "Author"
32 DATE = "Date"
33 CATEGORY = "Category"
34 EMAIL = "E-mail"
35 WEBSITE = "Website"
36  
37 ABOUT = "About"
38 PRINT_ADDON_INFO = "Print out addon info"
39  
40 CATEGORIES = {
41 ["Action Bars"] = "Action Bars",
42 ["Auction"] = "Auction",
43 ["Audio"] = "Audio",
44 ["Battlegrounds/PvP"] = "Battlegrounds/PvP",
45 ["Buffs"] = "Buffs",
46 ["Chat/Communication"] = "Chat/Communication",
47 ["Druid"] = "Druid",
48 ["Hunter"] = "Hunter",
49 ["Mage"] = "Mage",
50 ["Paladin"] = "Paladin",
51 ["Priest"] = "Priest",
52 ["Rogue"] = "Rogue",
53 ["Shaman"] = "Shaman",
54 ["Warlock"] = "Warlock",
55 ["Warrior"] = "Warrior",
56 ["Healer"] = "Healer",
57 ["Tank"] = "Tank",
58 ["Caster"] = "Caster",
59 ["Combat"] = "Combat",
60 ["Compilations"] = "Compilations",
61 ["Data Export"] = "Data Export",
62 ["Development Tools "] = "Development Tools ",
63 ["Guild"] = "Guild",
64 ["Frame Modification"] = "Frame Modification",
65 ["Interface Enhancements"] = "Interface Enhancements",
66 ["Inventory"] = "Inventory",
67 ["Library"] = "Library",
68 ["Map"] = "Map",
69 ["Mail"] = "Mail",
70 ["Miscellaneous"] = "Miscellaneous",
71 ["Quest"] = "Quest",
72 ["Raid"] = "Raid",
73 ["Tradeskill"] = "Tradeskill",
74 ["UnitFrame"] = "UnitFrame",
75 }
76 end
77  
78 setmetatable(CATEGORIES, { __index = function(self, key) -- case-insensitive
79 local lowerKey = string.lower(key)
80 for k,v in CATEGORIES do
81 if string.lower(k) == lowerKey then
82 return v
83 end
84 end
85 end })
86  
87 -- Create the library object
88  
89 local AceOO = AceLibrary("AceOO-2.0")
90 local AceAddon = AceOO.Class()
91 local AceEvent
92 local AceConsole
93 local AceModuleCore
94  
95 function AceAddon:ToString()
96 return "AceAddon"
97 end
98  
99 local function print(text)
100 DEFAULT_CHAT_FRAME:AddMessage(text)
101 end
102  
103 local AceDB
104 function AceAddon:ADDON_LOADED(name)
105 while table.getn(self.nextAddon) > 0 do
106 local addon = table.remove(self.nextAddon, 1)
107 table.insert(self.addons, addon)
108 if not self.addons[name] then
109 self.addons[name] = addon
110 end
111 self:InitializeAddon(addon, name)
112 end
113 end
114  
115 local function RegisterOnEnable(self)
116 if DEFAULT_CHAT_FRAME and DEFAULT_CHAT_FRAME.defaultLanguage then -- HACK
117 AceAddon.playerLoginFired = true
118 end
119 if AceAddon.playerLoginFired then
120 AceAddon.addonsStarted[self] = true
121 if type(self.OnEnable) == "function" and (type(self.IsActive) ~= "function" or self:IsActive()) and (not AceModuleCore or not AceModuleCore:IsModule(self) or AceModuleCore:IsModuleActive(self)) then
122 self:OnEnable()
123 end
124 else
125 if not AceAddon.addonsToOnEnable then
126 AceAddon.addonsToOnEnable = {}
127 end
128 table.insert(AceAddon.addonsToOnEnable, self)
129 end
130 end
131  
132 function AceAddon:InitializeAddon(addon, name)
133 if AceDB and AceOO.inherits(addon, AceDB) then
134 AceDB.InitializeDB(addon, name)
135 end
136  
137 if addon.name == nil then
138 addon.name = name
139 end
140 if GetAddOnMetadata then
141 -- TOC checks
142 if addon.title == nil then
143 addon.title = GetAddOnMetadata(name, "Title")
144 if addon.title then
145 local num = string.find(addon.title, " |cff7fff7f %-Ace2%-|r$")
146 if num then
147 addon.title = string.sub(addon.title, 1, num - 1)
148 end
149 end
150 end
151 if addon.notes == nil then
152 addon.notes = GetAddOnMetadata(name, "Notes")
153 end
154 if addon.version == nil then
155 addon.version = GetAddOnMetadata(name, "Version")
156 if addon.version then
157 if string.find(addon.version, "%$Revision: (%d+) %$") then
158 addon.version = string.gsub(addon.version, "%$Revision: (%d+) %$", "%1")
159 elseif string.find(addon.version, "%$Rev: (%d+) %$") then
160 addon.version = string.gsub(addon.version, "%$Rev: (%d+) %$", "%1")
161 elseif string.find(addon.version, "%$LastChangedRevision: (%d+) %$") then
162 addon.version = string.gsub(addon.version, "%$LastChangedRevision: (%d+) %$", "%1")
163 end
164 end
165 end
166 if addon.author == nil then
167 addon.author = GetAddOnMetadata(name, "Author")
168 end
169 if addon.date == nil then
170 addon.date = GetAddOnMetadata(name, "X-Date") or GetAddOnMetadata(name, "X-ReleaseDate")
171 if addon.date then
172 if string.find(addon.date, "%$Date: (.-) %$") then
173 addon.date = string.gsub(addon.date, "%$Date: (.-) %$", "%1")
174 elseif string.find(addon.date, "%$LastChangedDate: (.-) %$") then
175 addon.date = string.gsub(addon.date, "%$LastChangedDate: (.-) %$", "%1")
176 end
177 end
178 end
179 if addon.category == nil then
180 addon.category = GetAddOnMetadata(name, "X-Category")
181 end
182 if addon.email == nil then
183 addon.email = GetAddOnMetadata(name, "X-eMail") or GetAddOnMetadata(name, "X-Email")
184 end
185 if addon.website == nil then
186 addon.website = GetAddOnMetadata(name, "X-Website")
187 end
188 end
189 if type(addon.OnInitialize) == "function" and addon.OnInitialize ~= self.prototype.OnInitialize then
190 addon:OnInitialize()
191 end
192 RegisterOnEnable(addon)
193 end
194  
195 function AceAddon.prototype:PrintAddonInfo()
196 local x
197 if self.title then
198 x = "|cffffff7f" .. tostring(self.title) .. "|r"
199 elseif self.name then
200 x = "|cffffff7f" .. tostring(self.name) .. "|r"
201 else
202 x = "|cffffff7f<" .. tostring(self.class) .. " instance>|r"
203 end
204 if type(self.IsActive) == "function" then
205 if not self:IsActive() then
206 x = x .. " " .. STANDBY
207 end
208 end
209 if self.version then
210 x = x .. " - |cffffff7f" .. tostring(self.version) .. "|r"
211 end
212 if self.notes then
213 x = x .. " - " .. tostring(self.notes)
214 end
215 print(x)
216 if self.author then
217 print(" - |cffffff7f" .. AUTHOR .. ":|r " .. tostring(self.author))
218 end
219 if self.date then
220 print(" - |cffffff7f" .. DATE .. ":|r " .. tostring(self.date))
221 end
222 if self.category then
223 local category = CATEGORIES[self.category]
224 if category then
225 print(" - |cffffff7f" .. CATEGORY .. ":|r " .. category)
226 end
227 end
228 if self.email then
229 print(" - |cffffff7f" .. EMAIL .. ":|r " .. tostring(self.email))
230 end
231 if self.website then
232 print(" - |cffffff7f" .. WEBSITE .. ":|r " .. tostring(self.website))
233 end
234 end
235  
236 local options
237 function AceAddon:GetAceOptionsDataTable(target)
238 if not options then
239 options = {
240 about = {
241 name = ABOUT,
242 desc = PRINT_ADDON_INFO,
243 type = "execute",
244 func = "PrintAddonInfo",
245 }
246 }
247 end
248 return options
249 end
250  
251 function AceAddon:PLAYER_LOGIN()
252 self.playerLoginFired = true
253 if self.addonsToOnEnable then
254 while table.getn(self.addonsToOnEnable) > 0 do
255 local addon = table.remove(self.addonsToOnEnable, 1)
256 self.addonsStarted[addon] = true
257 if type(addon.OnEnable) == "function" and (type(addon.IsActive) ~= "function" or addon:IsActive()) and (not AceModuleCore or not AceModuleCore:IsModule(addon) or AceModuleCore:IsModuleActive(addon)) then
258 addon:OnEnable()
259 end
260 end
261 self.addonsToOnEnable = nil
262 end
263 end
264  
265 function AceAddon.prototype:Inject(t)
266 AceAddon:argCheck(t, 2, "table")
267 for k,v in pairs(t) do
268 self[k] = v
269 end
270 end
271  
272 function AceAddon.prototype:init()
273 if not AceEvent then
274 AceAddon:error(MAJOR_VERSION .. " requires AceEvent-2.0")
275 end
276 AceAddon.super.prototype.init(self)
277  
278 self.super = self.class.prototype
279  
280 AceAddon:RegisterEvent("ADDON_LOADED", "ADDON_LOADED", true)
281 table.insert(AceAddon.nextAddon, self)
282 end
283  
284 function AceAddon.prototype:ToString()
285 local x
286 if type(self.title) == "string" then
287 x = self.title
288 elseif type(self.name) == "string" then
289 x = self.name
290 else
291 x = "<" .. tostring(self.class) .. " instance>"
292 end
293 if (type(self.IsActive) == "function" and not self:IsActive()) or (AceModuleCore and AceModuleCore:IsModule(addon) and AceModuleCore:IsModuleActive(addon)) then
294 x = x .. " " .. STANDBY
295 end
296 return x
297 end
298  
299 if tonumber(date("%Y%m%d")) < 20060711 then
300 function AceAddon.prototype:OnInitialize()
301 local line = string.gsub(debugstack(), ".-\n(.-)\n.*", "%1")
302 print(line .. " - self.super.OnInitialize(self) is no longer supported. This will error on July 11, 2006.")
303 end
304 end
305  
306 AceAddon.new = function(self, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15, m16, m17, m18, m19, m20)
307 local class = AceOO.Classpool(self, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15, m16, m17, m18, m19, m20)
308 return class:new()
309 end
310  
311 local function external(self, major, instance)
312 if major == "AceEvent-2.0" then
313 AceEvent = instance
314  
315 AceEvent:embed(self)
316  
317 self:RegisterEvent("PLAYER_LOGIN", "PLAYER_LOGIN", true)
318 elseif major == "AceConsole-2.0" then
319 AceConsole = instance
320  
321 local slashCommands = { "/ace2" }
322 if not IsAddOnLoaded("Ace") then
323 table.insert(slashCommands, "/ace")
324 end
325 local function listAddon(addon, depth)
326 if not depth then
327 depth = 0
328 end
329  
330 local s = string.rep(" ", depth) .. " - " .. tostring(addon)
331 if addon.version then
332 s = s .. " - |cffffff7f" .. tostring(addon.version) .. "|r"
333 end
334 if addon.slashCommand then
335 s = s .. " |cffffff7f(" .. tostring(addon.slashCommand) .. ")|r"
336 end
337 print(s)
338 if type(addon.modules) == "table" then
339 for k,v in pairs(addon.modules) do
340 listAddon(v, depth + 1)
341 end
342 end
343 end
344 local function listNormalAddon(i)
345 local name,_,_,enabled,loadable = GetAddOnInfo(i)
346 if not loadable then
347 enabled = false
348 end
349 if self.addons[name] then
350 local addon = self.addons[name]
351 if not AceCoreAddon or not AceCoreAddon:IsModule(addon) then
352 listAddon(addon)
353 end
354 else
355 local s = " - " .. tostring(GetAddOnMetadata(i, "Title") or name)
356 local version = GetAddOnMetadata(i, "Version")
357 if version then
358 if string.find(version, "%$Revision: (%d+) %$") then
359 version = string.gsub(version, "%$Revision: (%d+) %$", "%1")
360 elseif string.find(version, "%$Rev: (%d+) %$") then
361 version = string.gsub(version, "%$Rev: (%d+) %$", "%1")
362 elseif string.find(version, "%$LastChangedRevision: (%d+) %$") then
363 version = string.gsub(version, "%$LastChangedRevision: (%d+) %$", "%1")
364 end
365 s = s .. " - |cffffff7f" .. version .. "|r"
366 end
367 if not enabled then
368 s = s .. " |cffff0000(disabled)|r"
369 end
370 if IsAddOnLoadOnDemand(i) then
371 s = s .. " |cff00ff00[LoD]|r"
372 end
373 print(s)
374 end
375 end
376 local function mySort(alpha, bravo)
377 return tostring(alpha) < tostring(bravo)
378 end
379 AceConsole.RegisterChatCommand(self, slashCommands, {
380 desc = "AddOn development framework",
381 name = "Ace2",
382 type = "group",
383 args = {
384 about = {
385 desc = "Get information about Ace2",
386 name = "About",
387 type = "execute",
388 func = function()
389 print("|cffffff7fAce2|r - |cffffff7f2.0." .. string.gsub(MINOR_VERSION, "%$Revision: (%d+) %$", "%1") .. "|r - AddOn development framework")
390 print(" - |cffffff7f" .. AUTHOR .. ":|r Ace Development Team")
391 print(" - |cffffff7f" .. WEBSITE .. ":|r http://www.wowace.com/")
392 end
393 },
394 list = {
395 desc = "List addons",
396 name = "List",
397 type = "group",
398 args = {
399 ace2 = {
400 desc = "List addons using Ace2",
401 name = "Ace2",
402 type = "execute",
403 func = function()
404 print("|cffffff7fAddon list:|r")
405 local AceCoreAddon = AceLibrary:HasInstance("AceCoreAddon-2.0") and AceLibrary("AceCoreAddon-2.0")
406 table.sort(self.addons, mySort)
407 for _,v in ipairs(self.addons) do
408 if not AceCoreAddon or not AceCoreAddon:IsModule(v) then
409 listAddon(v)
410 end
411 end
412 end
413 },
414 all = {
415 desc = "List all addons",
416 name = "All",
417 type = "execute",
418 func = function()
419 print("|cffffff7fAddon list:|r")
420 local AceCoreAddon = AceLibrary:HasInstance("AceCoreAddon-2.0") and AceLibrary("AceCoreAddon-2.0")
421 local count = GetNumAddOns()
422 for i = 1, count do
423 listNormalAddon(i)
424 end
425 end
426 },
427 enabled = {
428 desc = "List all enabled addons",
429 name = "Enabled",
430 type = "execute",
431 func = function()
432 print("|cffffff7fAddon list:|r")
433 local AceCoreAddon = AceLibrary:HasInstance("AceCoreAddon-2.0") and AceLibrary("AceCoreAddon-2.0")
434 local count = GetNumAddOns()
435 for i = 1, count do
436 local _,_,_,enabled,loadable = GetAddOnInfo(i)
437 if enabled and loadable then
438 listNormalAddon(i)
439 end
440 end
441 end
442 },
443 disabled = {
444 desc = "List all disabled addons",
445 name = "Disabled",
446 type = "execute",
447 func = function()
448 print("|cffffff7fAddon list:|r")
449 local AceCoreAddon = AceLibrary:HasInstance("AceCoreAddon-2.0") and AceLibrary("AceCoreAddon-2.0")
450 local count = GetNumAddOns()
451 for i = 1, count do
452 local _,_,_,enabled,loadable = GetAddOnInfo(i)
453 if not enabled or not loadable then
454 listNormalAddon(i)
455 end
456 end
457 end
458 },
459 lod = {
460 desc = "List all LoadOnDemand addons",
461 name = "LoadOnDemand",
462 type = "execute",
463 func = function()
464 print("|cffffff7fAddon list:|r")
465 local AceCoreAddon = AceLibrary:HasInstance("AceCoreAddon-2.0") and AceLibrary("AceCoreAddon-2.0")
466 local count = GetNumAddOns()
467 for i = 1, count do
468 if IsAddOnLoadOnDemand(i) then
469 listNormalAddon(i)
470 end
471 end
472 end
473 },
474 ace1 = {
475 desc = "List all addons using Ace1",
476 name = "Ace 1.x",
477 type = "execute",
478 func = function()
479 print("|cffffff7fAddon list:|r")
480 local count = GetNumAddOns()
481 for i = 1, count do
482 local dep1, dep2, dep3, dep4 = GetAddOnDependencies(i)
483 if dep1 == "Ace" or dep2 == "Ace" or dep3 == "Ace" or dep4 == "Ace" then
484 listNormalAddon(i)
485 end
486 end
487 end
488 },
489 libs = {
490 desc = "List all libraries using AceLibrary",
491 name = "Libraries",
492 type = "execute",
493 func = function()
494 if type(AceLibrary) == "table" and type(AceLibrary.libs) == "table" then
495 print("|cffffff7fLibrary list:|r")
496 for name, data in pairs(AceLibrary.libs) do
497 local s
498 if data.minor then
499 s = " - " .. tostring(name) .. "." .. tostring(data.minor)
500 else
501 s = " - " .. tostring(name)
502 end
503 if AceLibrary(name).slashCommand then
504 s = s .. " |cffffff7f(" .. tostring(AceLibrary(name).slashCommand) .. "|cffffff7f)"
505 end
506 print(s)
507 end
508 end
509 end
510 },
511 search = {
512 desc = "Search by name",
513 name = "Search",
514 type = "text",
515 usage = "<keyword>",
516 input = true,
517 get = false,
518 set = function(...)
519 for i,v in ipairs(arg) do
520 arg[i] = string.lower(string.gsub(string.gsub(v, '%*', '.*'), '%%', '%%%%'))
521 end
522 local count = GetNumAddOns()
523 for i = 1, count do
524 local name = GetAddOnInfo(i)
525 local good = true
526 for _,v in ipairs(arg) do
527 if not string.find(string.lower(name), v) then
528 good = false
529 break
530 end
531 end
532 if good then
533 listNormalAddon(i)
534 end
535 end
536 end
537 }
538 },
539 },
540 enable = {
541 desc = "Enable addon",
542 name = "Enable",
543 type = "text",
544 usage = "<addon>",
545 get = false,
546 set = function(text)
547 local name,title,_,_,_,reason = GetAddOnInfo(text)
548 if reason == "MISSING" then
549 print(string.format("|cffffff7fAce2:|r AddOn %q does not exist", text))
550 else
551 EnableAddOn(text)
552 print(string.format("|cffffff7fAce2:|r %s is now enabled", title or name))
553 end
554 end,
555 },
556 disable = {
557 desc = "Disable addon",
558 name = "Disable",
559 type = "text",
560 usage = "<addon>",
561 get = false,
562 set = function(text)
563 local name,title,_,_,_,reason = GetAddOnInfo(text)
564 if reason == "MISSING" then
565 print(string.format("|cffffff7fAce2:|r AddOn %q does not exist", text))
566 else
567 DisableAddOn(text)
568 print(string.format("|cffffff7fAce2:|r %s is now disabled", title or name))
569 end
570 end,
571 },
572 load = {
573 desc = "Load addon",
574 name = "Load",
575 type = "text",
576 usage = "<addon>",
577 get = false,
578 set = function(text)
579 local name,title,_,_,loadable,reason = GetAddOnInfo(text)
580 if reason == "MISSING" then
581 print(string.format("|cffffff7fAce2:|r AddOn %q does not exist.", text))
582 elseif not loadable then
583 print(string.format("|cffffff7fAce2:|r AddOn %q is not loadable. Reason: %s", text, reason))
584 else
585 LoadAddOn(text)
586 print(string.format("|cffffff7fAce2:|r %s is now loaded", title or name))
587 end
588 end
589 },
590 info = {
591 desc = "Display information",
592 name = "Information",
593 type = "execute",
594 func = function()
595 local mem, threshold = gcinfo()
596 print(string.format(" - |cffffff7fMemory usage [|r%.3f MiB|cffffff7f]|r", mem / 1024))
597 print(string.format(" - |cffffff7fThreshold [|r%.3f MiB|cffffff7f]|r", threshold / 1024))
598 print(string.format(" - |cffffff7fFramerate [|r%.0f fps|cffffff7f]|r", GetFramerate()))
599 local bandwidthIn, bandwidthOut, latency = GetNetStats()
600 bandwidthIn, bandwidthOut = floor(bandwidthIn * 1024), floor(bandwidthOut * 1024)
601 print(string.format(" - |cffffff7fLatency [|r%.0f ms|cffffff7f]|r", latency))
602 print(string.format(" - |cffffff7fBandwidth in [|r%.0f B/s|cffffff7f]|r", bandwidthIn))
603 print(string.format(" - |cffffff7fBandwidth out [|r%.0f B/s|cffffff7f]|r", bandwidthOut))
604 print(string.format(" - |cffffff7fTotal addons [|r%d|cffffff7f]|r", GetNumAddOns()))
605 print(string.format(" - |cffffff7fAce2 addons [|r%d|cffffff7f]|r", table.getn(self.addons)))
606 local ace = 0
607 local enabled = 0
608 local disabled = 0
609 local lod = 0
610 for i = 1, GetNumAddOns() do
611 local dep1, dep2, dep3, dep4 = GetAddOnDependencies(i)
612 if dep1 == "Ace" or dep2 == "Ace" or dep3 == "Ace" or dep4 == "Ace" then
613 ace = ace + 1
614 end
615 if IsAddOnLoadOnDemand(i) then
616 lod = lod + 1
617 end
618 local _,_,_,IsActive,loadable = GetAddOnInfo(i)
619 if not IsActive or not loadable then
620 disabled = disabled + 1
621 else
622 enabled = enabled + 1
623 end
624 end
625 print(string.format(" - |cffffff7fAce 1.x addons [|r%d|cffffff7f]|r", ace))
626 print(string.format(" - |cffffff7fLoadOnDemand addons [|r%d|cffffff7f]|r", lod))
627 print(string.format(" - |cffffff7fenabled addons [|r%d|cffffff7f]|r", enabled))
628 print(string.format(" - |cffffff7fdisabled addons [|r%d|cffffff7f]|r", disabled))
629 local libs = 0
630 if type(AceLibrary) == "table" and type(AceLibrary.libs) == "table" then
631 for _ in pairs(AceLibrary.libs) do
632 libs = libs + 1
633 end
634 end
635 print(string.format(" - |cffffff7fAceLibrary instances [|r%d|cffffff7f]|r", libs))
636 end
637 }
638 }
639 })
640 elseif major == "AceDB-2.0" then
641 AceDB = instance
642 elseif major == "AceModuleCore-2.0" then
643 AceModuleCore = instance
644 end
645 end
646  
647 local function activate(self, oldLib, oldDeactivate)
648 AceAddon = self
649  
650 if oldLib then
651 self.playerLoginFired = oldLib.playerLoginFired or DEFAULT_CHAT_FRAME and DEFAULT_CHAT_FRAME.defaultLanguage
652 self.addonsToOnEnable = oldLib.addonsToOnEnable
653 self.addons = oldLib.addons
654 self.nextAddon = oldLib.nextAddon
655 self.addonsStarted = oldLib.addonsStarted
656 end
657 if not self.addons then
658 self.addons = {}
659 end
660 if not self.nextAddon then
661 self.nextAddon = {}
662 end
663 if not self.addonsStarted then
664 self.addonsStarted = {}
665 end
666 if oldDeactivate then
667 oldDeactivate(oldLib)
668 end
669 end
670  
671 AceLibrary:Register(AceAddon, MAJOR_VERSION, MINOR_VERSION, activate, nil, external)
672 AceAddon = AceLibrary(MAJOR_VERSION)