-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtime.lua
55 lines (45 loc) · 1.74 KB
/
time.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
local addon = select(2,...);
local config = addon.config;
local map = addon._map;
local atlas = addon.SetAtlas;
local shown = addon.SetShown;
local select = select;
local format = string.format;
local GameTimeFrame = GameTimeFrame;
local CalendarGetDate = CalendarGetDate;
if (not IsAddOnLoaded('Blizzard_TimeManager')) then
LoadAddOn('Blizzard_TimeManager')
end
function map:SetCalendarDate()
if not config.times.calendar then
GameTimeFrame:Hide()
return
end
local _, _, day = CalendarGetDate();
local atlasFormat = "ui-hud-calendar-%d-%s";
GameTimeFrame:ClearAllPoints()
GameTimeFrame:SetSize(21, 19)
GameTimeFrame:SetPoint('TOPRIGHT', Minimap.BorderTop, 22, -1)
GameTimeFrame:SetHitRectInsets(0, 0, 0, 0)
GameTimeFrame:GetFontString():Hide()
local normal, pushed, highlight;
normal = GameTimeFrame:GetNormalTexture();
pushed = GameTimeFrame:GetPushedTexture();
highlight = GameTimeFrame:GetHighlightTexture();
atlas(normal, atlasFormat:format(day, "up"));
atlas(pushed, atlasFormat:format(day, "down"));
atlas(highlight, atlasFormat:format(day, "mouseover"));
end
TimeManagerClockButton:GetRegions():Hide()
TimeManagerClockButton:ClearAllPoints()
TimeManagerClockButton:SetWidth(40)
TimeManagerClockButton:SetHeight(18)
TimeManagerClockButton:SetPoint('TOPRIGHT', Minimap.BorderTop)
TimeManagerClockTicker:SetFont(config.assets.font, config.times.clock_font_size)
TimeManagerClockTicker:SetShadowOffset(1.25, -1.25)
TimeManagerClockTicker:SetPoint('TOPRIGHT', TimeManagerClockButton, -10, -2)
shown(TimeManagerClockTicker, config.times.clock)
TimeManagerAlarmFiredTexture:SetTexture(nil)
-- local TimeDate = CreateFrame('Frame')
-- TimeDate:RegisterEvent('PLAYER_LOGIN')
-- TimeDate:SetScript('OnEvent', map.GameTimeFrame_SetCalendarDate)