comparison DependencyLoader/frontend.lua @ 17:f825ccf94a89

fixed an indexing issue in Addon.lua moved most of the code in DependencyLoader.lua to Core.lua, and renamed the former to frontend.lua updated load.xml rearranged stuff in start.lua
author mckenziemc
date Sat, 11 Dec 2010 03:32:04 -0800
parents DependencyLoader/DependencyLoader.lua@a46bf694050c
children
comparison
equal deleted inserted replaced
16:1d8898cd1c82 17:f825ccf94a89
1 -- frontend.lua
2 -- Implements the frontend of DependenyLoader
3
4
5 local addonName, addonTable = ...
6
7
8 local print = addonTable.print
9 local debug = addonTable.debug
10
11 local Core = addonTable.classes.Core
12
13
14 local frontend = LibStub("AceAddon-3.0"):NewAddon(addonName, "AceEvent-3.0")
15 addonTable.frontend = frontend
16 _G[addonName] = frontend
17
18 frontend.addonTable = addonTable
19
20
21 function frontend:OnInitialize()
22 debug("Initializing", addonName)
23 self:Enable()
24 end
25
26
27 function frontend:OnEnable()
28 -- this may get called early so don't rely on
29 -- it as an indicator for PLAYER_LOGIN
30
31 if not IsLoggedIn() then
32 self:RegisterEvent("PLAYER_LOGIN")
33 end
34
35 Core:SetHooks()
36 Core:PrepareAllAddons()
37
38 print("Enabled", addonName)
39 end
40
41
42 function frontend:OnDisable()
43 Core:UnhookAll()
44
45 print("Disabled", addonName)
46 end
47
48 function frontend:PLAYER_LOGIN(...)
49 Core:ProcessEnableQueue()
50 end
51