-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinit.lua
32 lines (30 loc) · 945 Bytes
/
init.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
local addon = select(2,...);
local config = addon.config;
local map = addon._map;
local skin = addon.SetSkin;
local select = select;
local pairs = pairs;
local _G = _G;
function map:OnEvent(event, ...)
if event == 'PLAYER_LOGIN' then
if config.map.skin_button then
for index=1, Minimap:GetNumChildren() do
skin(select(index, Minimap:GetChildren()))
end
end
elseif event == 'CALENDAR_UPDATE_PENDING_INVITES' or event == 'PLAYER_ENTERING_WORLD' then
self:SetCalendarDate()
self:RefreshCollapseExpandButtonState(BUFF_ACTUAL_DISPLAY)
elseif event == 'UNIT_AURA' then
self:RefreshCollapseExpandButtonState(BUFF_ACTUAL_DISPLAY)
end
end
function map:init()
self:RegisterEvent('PLAYER_LOGIN')
self:RegisterEvent('UNIT_AURA')
self:RegisterEvent('PLAYER_ENTERING_WORLD')
self:RegisterEvent('ZONE_CHANGED_NEW_AREA')
self:RegisterEvent('CALENDAR_UPDATE_PENDING_INVITES')
self:SetScript('OnEvent', self.OnEvent)
end
map:init()