Mercurial > wow > buffalo2
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 70:1b0d7bcd252e | 71:6f8661094643 |
|---|---|
| 4 -- %file-revision% | 4 -- %file-revision% |
| 5 -- Fixes objective tracker positioning in relation to buff frame alterations | 5 -- Fixes objective tracker positioning in relation to buff frame alterations |
| 6 | 6 |
| 7 local plugin = CreateFrame('Frame', 'VeneerObjectives', UIParent) | 7 local plugin = CreateFrame('Frame', 'VeneerObjectives', UIParent) |
| 8 local vn, print = LibStub("LibKraken").register(VeneerController, plugin) | 8 local vn, print = LibStub("LibKraken").register(VeneerController, plugin) |
| 9 local ot | |
| 10 local otvn | |
| 11 | |
| 12 local ResetObjectiveTrackerAnchor = function() | |
| 13 | |
| 14 print('|cFFFF4400ObjectiveTracker_Initialize|r') | |
| 15 otvn = vn.GetVeneer(ot.BlocksFrame) | |
| 16 print(otvn:GetHeight()) | |
| 17 vn:print(ot:GetHeight(), ot:GetWidth()) | |
| 18 | |
| 19 | |
| 20 for i = 1, #ot.MODULES do | |
| 21 print(i, ot.MODULES[i]) | |
| 22 end | |
| 23 end | |
| 24 | |
| 25 local UpdateVeneer = function() | |
| 26 if not ot.initialized then | |
| 27 return | |
| 28 end | |
| 29 | |
| 30 ot:ClearAllPoints() | |
| 31 ot:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -5, -140) | |
| 32 end | |
| 33 | |
| 34 local CreateVeneer = function() | |
| 35 ot = ObjectiveTrackerFrame | |
| 36 hooksecurefunc('ObjectiveTracker_Initialize', ResetObjectiveTrackerAnchor) | |
| 37 hooksecurefunc('ObjectiveTracker_Update', UpdateVeneer) | |
| 38 end | |
| 39 | |
| 40 plugin.init = function() | |
| 41 if ObjectiveTrackerFrame then | |
| 42 print('tracker is already loaded') | |
| 43 CreateVeneer() | |
| 44 else | |
| 45 plugin:RegisterEvent('ADDON_LOADED') | |
| 46 plugin.ADDON_LOADED = function(self, addon) | |
| 47 if addon == 'Blizzard_ObjectiveTracker' then | |
| 48 print('responding to blizzard tracker loadin') | |
| 49 CreateVeneer() | |
| 50 end | |
| 51 end | |
| 52 end | |
| 53 end | |
| 54 |
