Advertisement
Guest User

Katae

a guest
Sep 5th, 2009
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. {   name = "Clock", parent = "Minimap", anchor_to = "bottomright", height = 17,
  2.     text = {
  3.         string = function()
  4.             local hour, min, pm = GetGameTime()
  5.             if hour > 12 then hour = hour - 12; pm = true elseif hour == 0 then hour = 12 end
  6.             return hour..":"..format("%02.f",min)..(pm and "P" or "A")
  7.         end, font = "04B_03__.TTF", size = 8, alpha = 0.8, justify_h = "right", justify_v = "bottom", y_off = -2,
  8.     },
  9.     OnEnter = function(self)
  10.         GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT")
  11.         GameTooltip:ClearLines()
  12.        
  13.         local hour, min, pm = GetGameTime()
  14.         if hour > 12 then hour = hour - 12; pm = true elseif hour == 0 then hour = 12 end
  15.         local rtime = hour..":"..format("%02.f",min)..(pm and "pm" or "am")
  16.         local ltime = format("%01.f",date("%I"))..":"..date("%M")..strlower(date("%p"))
  17.        
  18.         local wgtime = GetWintergraspWaitTime() or nil
  19.         if wgtime == nil then
  20.             wgtime = "In Progress"
  21.         else
  22.             local hour = tonumber(format("%01.f", floor(wgtime/3600)))
  23.             local min = format(hour>0 and "%02.f" or "%01.f", floor(wgtime/60 - (hour*60)))
  24.             local sec = format("%02.f", floor(wgtime - hour*3600 - min *60))               
  25.             wgtime = (hour>0 and hour..":" or "")..min..":"..sec
  26.         end
  27.        
  28.         GameTooltip:AddLine(date("%A, %B %d"),0.4,0.78,1)
  29.         GameTooltip:AddLine(" ")
  30.         GameTooltip:AddDoubleLine("Local Time",ltime,0.75,0.9,1,1,1,1)
  31.         GameTooltip:AddDoubleLine("Realm Time",rtime,0.75,0.9,1,1,1,1)
  32.         GameTooltip:AddLine(" ")
  33.         GameTooltip:AddDoubleLine("Time to Wintergrasp",wgtime,0.75,0.9,1,1,1,1)
  34.         GameTooltip:Show()
  35.     end,
  36.     OnLeave = HideTT,
  37.     OnClick = function(_,b) (b == "RightButton" and ToggleTimeManager or ToggleCalendar)() end
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement