Mercurial > wow > buffalo2
comparison ObjectiveUI.lua @ 19:605e8f0e46db
ObjectiveCore / Style / Events / Frame
- polishing the execution path for better performance
- make use of the Blizzard_ObjectiveTracker bitfield values to ensure compatibility in possible secure hooks
- avoid full updates when possible (using said bitfield values to indicate targeted sections)
- extreme streamlining of event handling layout: specific reason updates are invoked from API hooks; broader updates are invoked by when the event listener catches something vague like 'QUEST_LOG_UPDATE'
author | Nenue |
---|---|
date | Wed, 06 Apr 2016 07:38:35 -0400 |
parents | 880828018bf4 |
children | d5ee940de273 |
comparison
equal
deleted
inserted
replaced
18:d1812fb10ae6 | 19:605e8f0e46db |
---|---|
4 -- @file-revision@ @file-hash@ | 4 -- @file-revision@ @file-hash@ |
5 -- Created: 3/29/2016 7:07 PM | 5 -- Created: 3/29/2016 7:07 PM |
6 local B = select(2,...).frame | 6 local B = select(2,...).frame |
7 local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') | 7 local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') |
8 local print = B.print('Objectives') | 8 local print = B.print('Objectives') |
9 local Tracker, AutoQuest, Quest, Cheevs = mod.Tracker, mod.AutoQuest, mod.Quest, mod.Cheevs | 9 local DefaultTracker, AutoQuest, Quest, Cheevs = mod.DefaultTracker, mod.AutoQuest, mod.Quest, mod.Cheevs |
10 local itemButtonSize, itemButtonSpacing = 36, 1 | 10 local itemButtonSize, itemButtonSpacing = 36, 1 |
11 local tremove, tremovebyval = table.remove, table.removebyval | 11 local tremove, tremovebyval = table.remove, table.removebyval |
12 | 12 |
13 -------------------------------------------------------------------- | 13 -------------------------------------------------------------------- |
14 --- Functions responsible for: | 14 --- Functions responsible for: |
15 --- - UI interactions that propagate to the BlizzardUI (sending RemoveQuestWatch() on remove quest action) | 15 --- - UI interactions that propagate to the BlizzardUI (sending RemoveQuestWatch() on remove quest action) |
16 --- - | 16 --- - |
17 -------------------------------------------------------------------- | 17 -------------------------------------------------------------------- |
18 | 18 |
19 Tracker.Select = function(self) end | 19 DefaultTracker.Select = function(self) end |
20 Tracker.Open = function(self) end | 20 DefaultTracker.Open = function(self) end |
21 Tracker.Remove = function(self) end | 21 DefaultTracker.Remove = function(self) end |
22 Tracker.Report = function(self) | 22 DefaultTracker.Report = function(self) |
23 print('Stats:', self.numWatched,'items tracked,', self.numBlocks,'blocks assigned.') | 23 print('Stats:', self.numWatched,'items tracked,', self.numBlocks,'blocks assigned.') |
24 end | 24 end |
25 | 25 |
26 Tracker.OnMouseUp = function(self, button) | 26 DefaultTracker.OnMouseUp = function(self, button) |
27 print(self.handler.name, self.mainStyle, self.subStyle) | 27 print(self.handler.name, self.mainStyle, self.subStyle) |
28 if button == 'LeftButton' then | 28 if button == 'LeftButton' then |
29 if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then | 29 if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then |
30 self:Link() | 30 self:Link() |
31 elseif IsModifiedClick("QUESTWATCHTOGGLE") then | 31 elseif IsModifiedClick("QUESTWATCHTOGGLE") then |
41 self.modQuestWatch = nil | 41 self.modQuestWatch = nil |
42 self:SetStyle('TrackerBlock', self.handler.name, self.mainStyle, self.subStyle) | 42 self:SetStyle('TrackerBlock', self.handler.name, self.mainStyle, self.subStyle) |
43 print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r') | 43 print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r') |
44 end | 44 end |
45 | 45 |
46 Tracker.OnMouseDown = function(self, button) | 46 DefaultTracker.OnMouseDown = function(self, button) |
47 self:SetStyle('TrackerBlock', self.handler.name, 'MouseDown') | 47 self:SetStyle('TrackerBlock', self.handler.name, 'MouseDown') |
48 print(IsModifiedClick("CHATLINK"), IsModifiedClick("QUESTWATCHTOGGLE")) | 48 print(IsModifiedClick("CHATLINK"), IsModifiedClick("QUESTWATCHTOGGLE")) |
49 print(self.info.title) | 49 print(self.info.title) |
50 end | 50 end |
51 | |
51 | 52 |
52 AutoQuest.Select = function(self) | 53 AutoQuest.Select = function(self) |
53 if self.info.popupType == 'OFFER' then | 54 if self.info.popupType == 'OFFER' then |
54 ShowQuestOffer(self.info.questIndex) | 55 ShowQuestOffer(self.info.questIndex) |
55 else | 56 else |
56 ShowQuestComplete(self.info.questIndex) | 57 ShowQuestComplete(self.info.questIndex) |
57 end | 58 end |
58 RemoveAutoQuestPopUp(self.info.questID) | 59 RemoveAutoQuestPopUp(self.info.questID) |
59 end | 60 end |
60 | 61 |
61 Quest.Select = function(self) -- remote quests will get listed here as well, so their turn-in data needs to be checked | 62 Quest.Select = function(self) |
62 if AutoQuest.Info[self.info.questID] then | 63 if self.info.isAutoComplete and self.info.isComplete then |
63 AutoQuest.Select(self) | 64 ShowQuestComplete(self.info.questLogIndex) |
64 else | 65 else |
65 SetSuperTrackedQuestID(self.info.questID) | 66 SetSuperTrackedQuestID(self.info.questID) |
66 end | 67 end |
67 mod.UpdateWrapper() | |
68 end | 68 end |
69 | 69 |
70 Quest.Link = function(self) | 70 Quest.Link = function(self) |
71 local questLink = GetQuestLink(block.questLogIndex); | 71 local questLink = GetQuestLink(block.questLogIndex); |
72 if ( questLink ) then | 72 if ( questLink ) then |
90 end | 90 end |
91 Cheevs.Remove = function(self) | 91 Cheevs.Remove = function(self) |
92 RemoveTrackedAchievement(self.info.cheevID) | 92 RemoveTrackedAchievement(self.info.cheevID) |
93 end | 93 end |
94 Cheevs.OnMouseUp = function(self, button) | 94 Cheevs.OnMouseUp = function(self, button) |
95 Tracker.OnMouseUp(self, button) | 95 DefaultTracker.OnMouseUp(self, button) |
96 end | 96 end |
97 Cheevs.Link = function(self) | 97 Cheevs.Link = function(self) |
98 local achievementLink = GetAchievementLink(self.info.cheevID); | 98 local achievementLink = GetAchievementLink(self.info.cheevID); |
99 if ( achievementLink ) then | 99 if ( achievementLink ) then |
100 ChatEdit_InsertLink(achievementLink); | 100 ChatEdit_InsertLink(achievementLink); |