Mercurial > wow > buffalo2
view TimeManager/TimeManager.lua @ 58:f253baf6022d
ObjectiveTracker:
- Quest tracker now checks all of its allotted frames for data validity,
- it also uses GetQuestLogTitle to verify non-zero log indexes
author | Nenue |
---|---|
date | Fri, 08 Jul 2016 18:01:49 -0400 |
parents | dd9b5f59632c |
children | 07ef62fe201f |
line wrap: on
line source
-------------------------------------------- -- Veneer -- Clock/Coordinate multi-tool -- mouseover reveals coordinates by map yards, right-click toggles display -- Krakyn -- @project-revision@ @project-hash@ -- @file-revision@ @file-hash@ -- Created: 4/27/2016 1:02 AM -------------------------------------------- local B = select(2,...).frame local _G = _G local clock = B:RegisterModule("Clock", _G.VeneerClock) 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) local weekday, month, day, year = _G.CalendarGetDate() local hour, min = _G.GetGameTime() if hour > 12 then hour = hour - 12 end local posFunc, posF = _G.GetPlayerMapPosition, 100 local posFormat = "|cFF00FFFF%0.1f %0.1f|r" if self:IsMouseOver() then posFunc = _G.UnitPosition posFormat = "yds |cFFFFFF00%d %d|r" posF = 1 end local posX, posY = posFunc('player') 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 clock.OnMouseUp = function(self, button) if button == 'RightButton' then if self:IsVisible() then self:Hide() else self:Show() end end end -- runs once per login function clock:OnInitialize() print('clock thing') self:Show() end -- runs once per ui load clock.OnEnable = function(self) self:SetParent(_G.UIParent) self:SetPoint('TOPRIGHT', _G.UIParent, 'TOPRIGHT', -100, -2) self:SetScript('OnUpdate', clock.OnUpdate) self:Show() self.time:SetText('Clock stuff') end clock.Open = function(self) end clock.Close = function(self) end