-
Notifications
You must be signed in to change notification settings - Fork 1
/
EventAlert_InitFunction.lua
70 lines (58 loc) · 2.39 KB
/
EventAlert_InitFunction.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
-- The first event of this UI(Event sequence : "Onload"->"ADDON_LOADED")
function EventAlert_OnLoad(self)
-- To register events from 'EA_EventList' function array.
self:RegisterAllEvents()
--for k, v in pairs(EA_EventList) do
-- self:RegisterEvent(k,v)
--end
-- Init Slash Command as function name = =
EventAlert_InitSlashCommand()
-- Init Main Array
EventAlert_InitArray()
--Next Event : ADDON_LOADED
end
-----------------------------------------------------------------
function EventAlert_OnEvent(self, event, ...)
local func = EA_EventList[event]
if type(func) == "function" then func(self,event,...) end
end
-----------------------------------------------------------------
--If 'OnLoad' event had loaded, then excute this 'ADDON_LOADED' event.
function EventAlert_ADDON_LOADED(self, event, ...)
local arg1,arg2 = ...;
if (arg1 == EA_ADDONS_NAME) then
--'// 1. Load the Default Spell Arrays, but not apply to this player now.
EventAlert_LoadSpellArray();
localizedPlayerClass,EA_playerClass = UnitClass("player")
--'// 2. Check EAM version. If version isn't match. Load Default Spells automatically.
EventAlert_VersionCheck();
DEFAULT_CHAT_FRAME:AddMessage(EA_XLOAD_LOAD..EA_Config.Version.."\124r");
--'// 3. Start to check the savedvariables
--(Load savedvariables from WOW FOLDER\WTF\Account\youraccount\SavedVariables\EventAlertMod.lua)
EventAlert_InitArrayConfig()
EventAlert_InitArrayPosition()
EventAlert_InitArrayPos()
if (EA_Config.ShareSettings ~= true) then
EA_Position = EA_Pos[EA_playerClass];
if EA_Position.Tar_NewLine == nil then EA_Position.Tar_NewLine = true end;
if EA_Position.Execution == nil then EA_Position.Execution = 0 end;
if EA_Position.PlayerLv2BOSS == nil then EA_Position.PlayerLv2BOSS = true end;
end
EventAlert_InitArraySpecCheckPower()
EventAlert_Options_Init();
EventAlert_Icon_Options_Frame_Init();
-- EventAlert_Class_Events_Frame_Init();
-- EventAlert_Other_Events_Frame_Init();
-- EventAlert_Target_Events_Frame_Init();
-- EventAlert_SCD_Events_Frame_Init();
-- EventAlert_Group_Events_Frame_Init();
EventAlert_CreateFrames();
EAFun_HookTooltips();
end
end
-----------------------------------------------------------------
function EventAlert_InitSlashCommand()
SlashCmdList["EVENTALERTMOD"] = EventAlert_SlashHandler;
SLASH_EVENTALERTMOD1 = "/eventalertmod";
SLASH_EVENTALERTMOD2 = "/eam";
end