-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
42 lines (31 loc) · 1.2 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
----------------------------------------------------------------------------------------------------
-- Main file, create the main addon
--
--create the addon and store in the engine
local AddOnName, Engine = ...;
local AddOn = LibStub( "AceAddon-3.0"):NewAddon(AddOnName,
"AceEvent-3.0", 'AceTimer-3.0', 'AceHook-3.0',"AceComm-3.0");
Engine.Name = AddOnName;
Engine.AddOn = AddOn;
--store locale in the engine
local L = LibStub("AceLocale-3.0"):GetLocale(Engine.Name);
Engine.Locale = L;
--store the engine global
_G[AddOnName] = Engine;
--register entering the world
function AddOn:OnEnable()
self:RegisterEvent("PLAYER_ENTERING_WORLD");
end
--on entering the world we show the load message, including version and slash commands
function AddOn:PLAYER_ENTERING_WORLD()
--get version
local Version = AddOn:GetModule("version");
-- TODO: This broke with 11.0.2 (due to Ace addon not being updated yet?) We don't really need it, so going to disable it for now.
--print(string.format(L["LOAD_MESSAGE"],Version.Title,Version.Label,Engine.slash1,Engine.slash2));
self:UnregisterEvent("PLAYER_ENTERING_WORLD");
end
--init the addon
function AddOn:OnInitialize()
--setup options
AddOn:SetupOptions();
end