annotate Modules/ObjectiveTracker.lua @ 71:6f8661094643

- obtains veneer objects through a common function and track them as a unified table.
author Nenue
date Tue, 23 Aug 2016 06:35:08 -0400
parents ef4116179e2f
children d80db9a9b7e4
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@71 15 otvn = vn.GetVeneer(ot.BlocksFrame)
Nenue@71 16 print(otvn:GetHeight())
Nenue@71 17 vn:print(ot:GetHeight(), ot:GetWidth())
Nenue@71 18
Nenue@71 19
Nenue@71 20 for i = 1, #ot.MODULES do
Nenue@71 21 print(i, ot.MODULES[i])
Nenue@71 22 end
Nenue@71 23 end
Nenue@71 24
Nenue@71 25 local UpdateVeneer = function()
Nenue@71 26 if not ot.initialized then
Nenue@71 27 return
Nenue@71 28 end
Nenue@71 29
Nenue@71 30 ot:ClearAllPoints()
Nenue@71 31 ot:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -5, -140)
Nenue@71 32 end
Nenue@71 33
Nenue@71 34 local CreateVeneer = function()
Nenue@71 35 ot = ObjectiveTrackerFrame
Nenue@71 36 hooksecurefunc('ObjectiveTracker_Initialize', ResetObjectiveTrackerAnchor)
Nenue@71 37 hooksecurefunc('ObjectiveTracker_Update', UpdateVeneer)
Nenue@71 38 end
Nenue@71 39
Nenue@71 40 plugin.init = function()
Nenue@71 41 if ObjectiveTrackerFrame then
Nenue@71 42 print('tracker is already loaded')
Nenue@71 43 CreateVeneer()
Nenue@71 44 else
Nenue@71 45 plugin:RegisterEvent('ADDON_LOADED')
Nenue@71 46 plugin.ADDON_LOADED = function(self, addon)
Nenue@71 47 if addon == 'Blizzard_ObjectiveTracker' then
Nenue@71 48 print('responding to blizzard tracker loadin')
Nenue@71 49 CreateVeneer()
Nenue@71 50 end
Nenue@71 51 end
Nenue@71 52 end
Nenue@71 53 end
Nenue@71 54