Mercurial > wow > buffalo2
comparison ObjectiveUI.lua @ 21:d5ee940de273
use hardcoded aesthetic manipulations over loadstring cramming
| author | Nenue |
|---|---|
| date | Fri, 08 Apr 2016 06:12:05 -0400 |
| parents | 605e8f0e46db |
| children | 9b3fa734abff |
comparison
equal
deleted
inserted
replaced
| 20:6bd2102d340b | 21:d5ee940de273 |
|---|---|
| 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 DefaultTracker, AutoQuest, Quest, Cheevs = mod.DefaultTracker, mod.AutoQuest, mod.Quest, mod.Cheevs | 9 local Default, AutoQuest, Quest, Cheevs = mod.DefaultHandler, 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 DefaultTracker.Select = function(self) end | 19 Default.Select = function(self) end |
| 20 DefaultTracker.Open = function(self) end | 20 Default.Open = function(self) end |
| 21 DefaultTracker.Remove = function(self) end | 21 Default.Remove = function(self) end |
| 22 DefaultTracker.Report = function(self) | 22 Default.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 DefaultTracker.OnMouseUp = function(self, button) | 26 Default.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 |
| 37 self:Open() | 37 self:Open() |
| 38 end | 38 end |
| 39 self.initialButton = nil | 39 self.initialButton = nil |
| 40 self.modChatLink = nil | 40 self.modChatLink = nil |
| 41 self.modQuestWatch = nil | 41 self.modQuestWatch = nil |
| 42 self:SetStyle('TrackerBlock', self.handler.name, self.mainStyle, self.subStyle) | 42 mod:Update(self.handler.updateReasonModule) |
| 43 print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r') | 43 print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r') |
| 44 end | 44 end |
| 45 | 45 |
| 46 DefaultTracker.OnMouseDown = function(self, button) | 46 Default.OnMouseDown = function(self, button) |
| 47 self:SetStyle('TrackerBlock', self.handler.name, 'MouseDown') | |
| 48 print(IsModifiedClick("CHATLINK"), IsModifiedClick("QUESTWATCHTOGGLE")) | 47 print(IsModifiedClick("CHATLINK"), IsModifiedClick("QUESTWATCHTOGGLE")) |
| 49 print(self.info.title) | 48 print(self.info.title) |
| 50 end | 49 end |
| 51 | 50 |
| 52 | 51 |
| 84 | 83 |
| 85 | 84 |
| 86 ----------------------------- | 85 ----------------------------- |
| 87 --- CHEEVS | 86 --- CHEEVS |
| 88 Cheevs.Select = function(self) | 87 Cheevs.Select = function(self) |
| 89 self:SetStyle('TrackerBlock', self.info.type, 'Normal') | 88 --mod:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT) |
| 90 end | 89 end |
| 91 Cheevs.Remove = function(self) | 90 Cheevs.Remove = function(self) |
| 92 RemoveTrackedAchievement(self.info.cheevID) | 91 RemoveTrackedAchievement(self.info.cheevID) |
| 93 end | 92 end |
| 94 Cheevs.OnMouseUp = function(self, button) | 93 Cheevs.OnMouseUp = function(self, button) |
| 95 DefaultTracker.OnMouseUp(self, button) | 94 Default.OnMouseUp(self, button) |
| 96 end | 95 end |
| 97 Cheevs.Link = function(self) | 96 Cheevs.Link = function(self) |
| 98 local achievementLink = GetAchievementLink(self.info.cheevID); | 97 local achievementLink = GetAchievementLink(self.info.cheevID); |
| 99 if ( achievementLink ) then | 98 if ( achievementLink ) then |
| 100 ChatEdit_InsertLink(achievementLink); | 99 ChatEdit_InsertLink(achievementLink); |
| 109 AchievementFrame_ToggleAchievementFrame(); | 108 AchievementFrame_ToggleAchievementFrame(); |
| 110 end | 109 end |
| 111 AchievementFrame_SelectAchievement(self.info.cheevID); | 110 AchievementFrame_SelectAchievement(self.info.cheevID); |
| 112 end | 111 end |
| 113 | 112 |
| 113 local Bonus = mod.Bonus | |
| 114 Bonus.Remove = function(self, questID) | |
| 115 end |
