# HG changeset patch # User Nenue # Date 1464828494 14400 # Node ID ed74c5cabe987caa312924b0eedd332eb4c5aab0 # Parent 5cedcb683edac11e9d4db8ef9bbe5a5e502101cc 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 diff -r 5cedcb683eda -r ed74c5cabe98 ObjectiveTracker/Layout.lua --- a/ObjectiveTracker/Layout.lua Fri Apr 29 17:06:48 2016 -0400 +++ b/ObjectiveTracker/Layout.lua Wed Jun 01 20:48:14 2016 -0400 @@ -439,7 +439,12 @@ return lineIndex end - +-- Resets blocks to hidden if the tracker framescript gets disrupted +Default.OnHide = function(self) + for i, block in pairs(self.handler.usedBlocks) do + block:Hide() + end +end ---------- --- Top level methods diff -r 5cedcb683eda -r ed74c5cabe98 ObjectiveTracker/ObjectiveTracker.lua --- a/ObjectiveTracker/ObjectiveTracker.lua Fri Apr 29 17:06:48 2016 -0400 +++ b/ObjectiveTracker/ObjectiveTracker.lua Wed Jun 01 20:48:14 2016 -0400 @@ -245,6 +245,8 @@ frame.title:SetText(handler.displayName) frame:SetWidth(c.Width) frame.previousOffset = 0 + frame:SetScript('OnHide', T.DefaultHandler.OnHide) + frame.handler = handler handler.frame = frame handler.numBlocks = 0 @@ -499,7 +501,7 @@ function T:OnInitialize() local c = T.Conf.Wrapper VeneerData = _G.VeneerData - VeneerData.CallLog = VeneerData.CallLog or {} + --VeneerData.CallLog = VeneerData.CallLog or {} if not T.isHooked then T.isHooked = true for _, func in ipairs(BlizzHooks) do diff -r 5cedcb683eda -r ed74c5cabe98 ObjectiveTracker/ObjectiveTracker.xml --- a/ObjectiveTracker/ObjectiveTracker.xml Fri Apr 29 17:06:48 2016 -0400 +++ b/ObjectiveTracker/ObjectiveTracker.xml Wed Jun 01 20:48:14 2016 -0400 @@ -158,37 +158,6 @@ - - - - self.toggle = true - Veneer.RegisterModuleFrame(self, 'Clock') - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 5cedcb683eda -r ed74c5cabe98 TimeManager/TimeManager.lua --- a/TimeManager/TimeManager.lua Fri Apr 29 17:06:48 2016 -0400 +++ b/TimeManager/TimeManager.lua Wed Jun 01 20:48:14 2016 -0400 @@ -1,26 +1,39 @@ -------------------------------------------- -- 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, _G = select(2,...).frame, _G -local clock = B:RegisterModule("Clock", VeneerClock) +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 print = B.print('XML') - +-- runs when visible clock.OnUpdate = function(self) - local weekday, month, day, year = CalendarGetDate() - local hour, min = GetGameTime() + local weekday, month, day, year = _G.CalendarGetDate() + local hour, min = _G.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) + local posFunc, posF = _G.GetPlayerMapPosition, 100 + local posFormat = "|cFF00FFFF%0.1f %0.1f|r" + if self:IsMouseOver() then + posFunc = _G.UnitPosition + posFormat = "|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) end +-- hide/show toggler clock.OnMouseUp = function(self, button) if button == 'RightButton' then if self:IsVisible() then @@ -31,7 +44,17 @@ 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 \ No newline at end of file diff -r 5cedcb683eda -r ed74c5cabe98 TimeManager/TimeManager.xml --- a/TimeManager/TimeManager.xml Fri Apr 29 17:06:48 2016 -0400 +++ b/TimeManager/TimeManager.xml Wed Jun 01 20:48:14 2016 -0400 @@ -1,4 +1,35 @@ + + + + + self.toggle = true + Veneer.RegisterModuleFrame(self, 'Clock') + + + + + + + + + + + + + + + + + + + + + + + +