annotate TimeManager/TimeManager.lua @ 51:4586229986e6
disambiguate local module names
author |
Nenue |
date |
Fri, 29 Apr 2016 10:52:57 -0400 |
parents |
1a322b92dbfa |
children |
ed74c5cabe98 |
rev |
line source |
Nenue@47
|
1 --------------------------------------------
|
Nenue@47
|
2 -- Veneer
|
Nenue@47
|
3 -- Krakyn
|
Nenue@47
|
4 -- @project-revision@ @project-hash@
|
Nenue@47
|
5 -- @file-revision@ @file-hash@
|
Nenue@47
|
6 -- Created: 4/27/2016 1:02 AM
|
Nenue@47
|
7 --------------------------------------------
|
Nenue@47
|
8
|
Nenue@47
|
9 local B, _G = select(2,...).frame, _G
|
Nenue@47
|
10 local clock = B:RegisterModule("Clock", VeneerClock)
|
Nenue@47
|
11 local weekDays = {'Su', 'M', 'T', 'W', 'R' ,'F', 'Sa' }
|
Nenue@47
|
12
|
Nenue@47
|
13 local print = B.print('XML')
|
Nenue@47
|
14
|
Nenue@47
|
15 clock.OnUpdate = function(self)
|
Nenue@47
|
16 local weekday, month, day, year = CalendarGetDate()
|
Nenue@47
|
17 local hour, min = GetGameTime()
|
Nenue@47
|
18 if hour > 12 then
|
Nenue@47
|
19 hour = hour - 12
|
Nenue@47
|
20 end
|
Nenue@47
|
21 self.time:SetFormattedText("|cAAFFFFFF%s|r |cFF44FFFF%s|r|c88FFFFFF/|r|cFF44FFFF%s|r %d:%02d", weekDays[weekday], month, day, hour, min)
|
Nenue@47
|
22 end
|
Nenue@47
|
23
|
Nenue@47
|
24 clock.OnMouseUp = function(self, button)
|
Nenue@47
|
25 if button == 'RightButton' then
|
Nenue@47
|
26 if self:IsVisible() then
|
Nenue@47
|
27 self:Hide()
|
Nenue@47
|
28 else
|
Nenue@47
|
29 self:Show()
|
Nenue@47
|
30 end
|
Nenue@47
|
31 end
|
Nenue@47
|
32 end
|
Nenue@47
|
33
|
Nenue@47
|
34 function clock:OnInitialize()
|
Nenue@47
|
35 print('clock thing')
|
Nenue@47
|
36 self:Show()
|
Nenue@47
|
37 end |