Mercurial > wow > buffalo2
diff TimeManager/TimeManager.lua @ 47:1a322b92dbfa
file cleanup
author | Nenue |
---|---|
date | Thu, 28 Apr 2016 05:54:21 -0400 |
parents | |
children | ed74c5cabe98 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TimeManager/TimeManager.lua Thu Apr 28 05:54:21 2016 -0400 @@ -0,0 +1,37 @@ +-------------------------------------------- +-- Veneer +-- Krakyn +-- @project-revision@ @project-hash@ +-- @file-revision@ @file-hash@ +-- Created: 4/27/2016 1:02 AM +-------------------------------------------- + +local B, _G = select(2,...).frame, _G +local clock = B:RegisterModule("Clock", VeneerClock) +local weekDays = {'Su', 'M', 'T', 'W', 'R' ,'F', 'Sa' } + +local print = B.print('XML') + +clock.OnUpdate = function(self) + local weekday, month, day, year = CalendarGetDate() + local hour, min = GetGameTime() + if hour > 12 then + hour = hour - 12 + end + self.time:SetFormattedText("|cAAFFFFFF%s|r |cFF44FFFF%s|r|c88FFFFFF/|r|cFF44FFFF%s|r %d:%02d", weekDays[weekday], month, day, hour, min) +end + +clock.OnMouseUp = function(self, button) + if button == 'RightButton' then + if self:IsVisible() then + self:Hide() + else + self:Show() + end + end +end + +function clock:OnInitialize() + print('clock thing') + self:Show() +end \ No newline at end of file