diff TimeManager/TimeManager.lua @ 55:dd9b5f59632c v1.0a-release

Core - updated comment notes Objectives - force hide blocks when their tracker is hidden Clock - convert clock into its own module - display zone coordinates alongside time
author Nenue
date Fri, 10 Jun 2016 20:52:27 -0400
parents ed74c5cabe98
children 07ef62fe201f
line wrap: on
line diff
--- a/TimeManager/TimeManager.lua	Wed Jun 01 20:48:14 2016 -0400
+++ b/TimeManager/TimeManager.lua	Fri Jun 10 20:52:27 2016 -0400
@@ -14,6 +14,7 @@
 local print = B.print('XML') -- debug hook
 -- weekday abbreviations used in display
 local weekDays = {'Su', 'M', 'T', 'W', 'R' ,'F', 'Sa' }
+local months = {'JA', 'FB', 'MR', 'AP', 'MY', 'JN', 'JL', 'AG', 'SP', 'OC', 'NV', 'DC'}
 
 -- runs when visible
 clock.OnUpdate = function(self)
@@ -26,11 +27,13 @@
   local posFormat = "|cFF00FFFF%0.1f %0.1f|r"
   if self:IsMouseOver() then
     posFunc = _G.UnitPosition
-    posFormat = "|cFFFFFF00%d %d|r"
+    posFormat = "yds |cFFFFFF00%d %d|r"
     posF = 1
   end
+
   local posX, posY = posFunc('player')
-  self.time:SetFormattedText(posFormat.. " |cAAFFFFFF%s|r |cFF44FFFF%s|r|c88FFFFFF/|r|cFF44FFFF%s|r %d:%02d", posX * posF, posY * posF, weekDays[weekday], month, day, hour, min)
+  self.coords:SetFormattedText(posFormat, posX * posF, posY * posF)
+  self.time:SetFormattedText("%s |cFF44FFFF%s|r|c88FFFFFF%s|r %d:%02d", weekDays[weekday], day, months[month], hour, min)
 end
 
 -- hide/show toggler
@@ -57,4 +60,9 @@
   self:SetScript('OnUpdate', clock.OnUpdate)
   self:Show()
   self.time:SetText('Clock stuff')
+end
+
+clock.Open = function(self)
+end
+clock.Close = function(self)
 end
\ No newline at end of file