annotate Modules/ObjectiveTracker.lua @ 72:d80db9a9b7e4

- created 'VeneerTemplate' xml - implement drag drop parent re-anchoring
author Nenue
date Tue, 23 Aug 2016 14:53:38 -0400
parents 6f8661094643
children 95ed343c3a42
rev   line source
Nenue@62 1 -- Veneer
Nenue@62 2 -- ObjectiveTracker.lua
Nenue@62 3 -- Created: 8/16/2016 8:19 AM
Nenue@62 4 -- %file-revision%
Nenue@62 5 -- Fixes objective tracker positioning in relation to buff frame alterations
Nenue@62 6
Nenue@62 7 local plugin = CreateFrame('Frame', 'VeneerObjectives', UIParent)
Nenue@71 8 local vn, print = LibStub("LibKraken").register(VeneerController, plugin)
Nenue@71 9 local ot
Nenue@71 10 local otvn
Nenue@71 11
Nenue@71 12 local ResetObjectiveTrackerAnchor = function()
Nenue@71 13
Nenue@71 14 print('|cFFFF4400ObjectiveTracker_Initialize|r')
Nenue@72 15 otvn = vn.GetVeneer(ot)
Nenue@71 16 print(otvn:GetHeight())
Nenue@71 17
Nenue@71 18
Nenue@71 19 for i = 1, #ot.MODULES do
Nenue@71 20 print(i, ot.MODULES[i])
Nenue@71 21 end
Nenue@72 22 ot:ClearAllPoints()
Nenue@72 23 ot:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -5, -140)
Nenue@72 24 print(ot:GetHeight(), ot:GetWidth())
Nenue@72 25 local width, height = ot:GetSize()
Nenue@72 26 ot:SetSize(width, height)
Nenue@72 27
Nenue@72 28 print(ot:GetHeight(), ot:GetWidth())
Nenue@72 29 --vn.GetVeneer(ot):SetAllPoints(ot)
Nenue@71 30 end
Nenue@71 31
Nenue@71 32 local UpdateVeneer = function()
Nenue@72 33 if not ot.initialized or not otvn then
Nenue@71 34 return
Nenue@71 35 end
Nenue@71 36
Nenue@72 37
Nenue@72 38
Nenue@72 39 print(ot:GetPoint(1),ot:GetPoint(2), ot:GetSize())
Nenue@72 40 print(ot:GetTop(), ot:GetLeft())
Nenue@72 41 print(ot:GetBottom(), ot:GetRight())
Nenue@72 42 print(otvn:GetTop(), otvn:GetLeft())
Nenue@72 43 print(otvn:GetBottom(), otvn:GetRight())
Nenue@72 44 otvn:Show()
Nenue@71 45 end
Nenue@71 46
Nenue@71 47 local CreateVeneer = function()
Nenue@71 48 ot = ObjectiveTrackerFrame
Nenue@71 49 hooksecurefunc('ObjectiveTracker_Initialize', ResetObjectiveTrackerAnchor)
Nenue@71 50 hooksecurefunc('ObjectiveTracker_Update', UpdateVeneer)
Nenue@71 51 end
Nenue@71 52
Nenue@71 53 plugin.init = function()
Nenue@71 54 if ObjectiveTrackerFrame then
Nenue@71 55 print('tracker is already loaded')
Nenue@71 56 CreateVeneer()
Nenue@71 57 else
Nenue@71 58 plugin:RegisterEvent('ADDON_LOADED')
Nenue@71 59 plugin.ADDON_LOADED = function(self, addon)
Nenue@71 60 if addon == 'Blizzard_ObjectiveTracker' then
Nenue@71 61 print('responding to blizzard tracker loadin')
Nenue@71 62 CreateVeneer()
Nenue@71 63 end
Nenue@71 64 end
Nenue@71 65 end
Nenue@71 66 end
Nenue@71 67