annotate ObjectiveUI.lua @ 16:880828018bf4

ObjectiveEvents - trim down the number of events that fire full updates - begin the general outline for determining which trackers need to refresh - handlers for accepting and completing auto-popup quests ObjectiveFrame - correct variables for money reward calculation - make sure everythign is scaling to the font strings and that the font strings aren't being pinned by SetSize ObjectiveInfo - implementation of autoquest popups - discern between internal and client bonus objective indexes - acquire the correct data set from bonus objective query ObjectiveStyle - look for a style table under the previously interpreted set before deferring standard options - horizontal/vertical options in gradient - remove height-fixing for font strings
author Nenue
date Tue, 05 Apr 2016 00:39:12 -0400
parents ed642234f017
children 605e8f0e46db
rev   line source
Nenue@0 1 --- ${PACKAGE_NAME}
Nenue@0 2 -- @file-author@
Nenue@0 3 -- @project-revision@ @project-hash@
Nenue@0 4 -- @file-revision@ @file-hash@
Nenue@0 5 -- Created: 3/29/2016 7:07 PM
Nenue@0 6 local B = select(2,...).frame
Nenue@0 7 local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
Nenue@0 8 local print = B.print('Objectives')
Nenue@0 9 local Tracker, AutoQuest, Quest, Cheevs = mod.Tracker, mod.AutoQuest, mod.Quest, mod.Cheevs
Nenue@6 10 local itemButtonSize, itemButtonSpacing = 36, 1
Nenue@7 11 local tremove, tremovebyval = table.remove, table.removebyval
Nenue@0 12
Nenue@0 13 --------------------------------------------------------------------
Nenue@13 14 --- Functions responsible for:
Nenue@13 15 --- - UI interactions that propagate to the BlizzardUI (sending RemoveQuestWatch() on remove quest action)
Nenue@13 16 --- -
Nenue@0 17 --------------------------------------------------------------------
Nenue@0 18
Nenue@0 19 Tracker.Select = function(self) end
Nenue@0 20 Tracker.Open = function(self) end
Nenue@0 21 Tracker.Remove = function(self) end
Nenue@0 22 Tracker.Report = function(self)
Nenue@0 23 print('Stats:', self.numWatched,'items tracked,', self.numBlocks,'blocks assigned.')
Nenue@0 24 end
Nenue@0 25
Nenue@0 26 Tracker.OnMouseUp = function(self, button)
Nenue@14 27 print(self.handler.name, self.mainStyle, self.subStyle)
Nenue@9 28 if button == 'LeftButton' then
Nenue@9 29 if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then
Nenue@7 30 self:Link()
Nenue@9 31 elseif IsModifiedClick("QUESTWATCHTOGGLE") then
Nenue@1 32 self:Remove()
Nenue@7 33 else
Nenue@7 34 self:Select()
Nenue@1 35 end
Nenue@0 36 elseif button == 'RightButton' then
Nenue@0 37 self:Open()
Nenue@0 38 end
Nenue@1 39 self.initialButton = nil
Nenue@7 40 self.modChatLink = nil
Nenue@7 41 self.modQuestWatch = nil
Nenue@14 42 self:SetStyle('TrackerBlock', self.handler.name, self.mainStyle, self.subStyle)
Nenue@8 43 print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r')
Nenue@0 44 end
Nenue@0 45
Nenue@0 46 Tracker.OnMouseDown = function(self, button)
Nenue@14 47 self:SetStyle('TrackerBlock', self.handler.name, 'MouseDown')
Nenue@8 48 print(IsModifiedClick("CHATLINK"), IsModifiedClick("QUESTWATCHTOGGLE"))
Nenue@0 49 print(self.info.title)
Nenue@0 50 end
Nenue@0 51
Nenue@16 52 AutoQuest.Select = function(self)
Nenue@16 53 if self.info.popupType == 'OFFER' then
Nenue@16 54 ShowQuestOffer(self.info.questIndex)
Nenue@16 55 else
Nenue@16 56 ShowQuestComplete(self.info.questIndex)
Nenue@16 57 end
Nenue@16 58 RemoveAutoQuestPopUp(self.info.questID)
Nenue@16 59 end
Nenue@16 60
Nenue@16 61 Quest.Select = function(self) -- remote quests will get listed here as well, so their turn-in data needs to be checked
Nenue@16 62 if AutoQuest.Info[self.info.questID] then
Nenue@16 63 AutoQuest.Select(self)
Nenue@16 64 else
Nenue@16 65 SetSuperTrackedQuestID(self.info.questID)
Nenue@16 66 end
Nenue@7 67 mod.UpdateWrapper()
Nenue@7 68 end
Nenue@16 69
Nenue@7 70 Quest.Link = function(self)
Nenue@7 71 local questLink = GetQuestLink(block.questLogIndex);
Nenue@7 72 if ( questLink ) then
Nenue@7 73 ChatEdit_InsertLink(questLink);
Nenue@7 74 end
Nenue@0 75 end
Nenue@0 76 Quest.Open = function(self)
Nenue@1 77 QuestMapFrame_OpenToQuestDetails(self.info.questID)
Nenue@1 78 end
Nenue@1 79
Nenue@1 80 Quest.Remove = function(self)
Nenue@5 81 print('removing', self.info.questLogIndex, 'from watcher')
Nenue@5 82 RemoveQuestWatch(self.info.questLogIndex)
Nenue@0 83 end
Nenue@0 84
Nenue@0 85
Nenue@0 86 -----------------------------
Nenue@0 87 --- CHEEVS
Nenue@0 88 Cheevs.Select = function(self)
Nenue@13 89 self:SetStyle('TrackerBlock', self.info.type, 'Normal')
Nenue@0 90 end
Nenue@8 91 Cheevs.Remove = function(self)
Nenue@8 92 RemoveTrackedAchievement(self.info.cheevID)
Nenue@8 93 end
Nenue@9 94 Cheevs.OnMouseUp = function(self, button)
Nenue@9 95 Tracker.OnMouseUp(self, button)
Nenue@8 96 end
Nenue@7 97 Cheevs.Link = function(self)
Nenue@8 98 local achievementLink = GetAchievementLink(self.info.cheevID);
Nenue@8 99 if ( achievementLink ) then
Nenue@8 100 ChatEdit_InsertLink(achievementLink);
Nenue@8 101 end
Nenue@7 102 end
Nenue@0 103
Nenue@0 104 Cheevs.Open = function(self)
Nenue@3 105 if ( not AchievementFrame ) then
Nenue@3 106 AchievementFrame_LoadUI();
Nenue@3 107 end
Nenue@3 108 if ( not AchievementFrame:IsShown() ) then
Nenue@3 109 AchievementFrame_ToggleAchievementFrame();
Nenue@3 110 end
Nenue@3 111 AchievementFrame_SelectAchievement(self.info.cheevID);
Nenue@0 112 end
Nenue@0 113