Nenue@28: --- ${PACKAGE_NAME} Nenue@28: -- @file-author@ Nenue@28: -- @project-revision@ @project-hash@ Nenue@28: -- @file-revision@ @file-hash@ Nenue@28: -- Created: 4/13/2016 7:49 PM Nenue@28: local B = select(2,...).frame Nenue@28: local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') Nenue@29: local print = B.print('Info') Nenue@29: local lprint = B.print('Line') Nenue@29: local AutoQuest, Quest = T.AutoQuest, T.Quest Nenue@28: local ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp = ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp Nenue@29: local GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle = GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle Nenue@29: --- Data retrieval Nenue@29: function AutoQuest:GetNumWatched () Nenue@45: local numWatched = GetNumAutoQuestPopUps() Nenue@45: local numAll = numWatched Nenue@28: Nenue@45: self.print('GetNumWatched', numWatched, 'popups detected') Nenue@45: for i = 1, numWatched do Nenue@45: self:GetInfo(i) Nenue@45: end Nenue@45: Nenue@45: for i, block in ipairs(self.usedBlocks) do Nenue@45: if not GetAutoQuestPopUp(block.info.id) then Nenue@45: self:FreeBlock(block) Nenue@45: end Nenue@45: end Nenue@45: Nenue@45: self.numWatched = numWatched Nenue@45: self.WatchList = self.Info Nenue@45: return numWatched Nenue@29: end Nenue@45: AutoQuest.GetInfo = function(self, index) Nenue@29: Nenue@29: Nenue@45: local questID, type = GetAutoQuestPopUp(index) Nenue@29: local questLogIndex = GetQuestLogIndexByID(questID) Nenue@29: local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questLogIndex) Nenue@29: Nenue@45: self.Info[index] = self.Info[index] or {} Nenue@45: local popup = self.Info[index] Nenue@30: popup.questID = questID Nenue@45: popup.id = index Nenue@29: popup.title = title Nenue@29: popup.description = type Nenue@29: popup.popupType = type Nenue@34: popup.logIndex = questLogIndex Nenue@29: Nenue@29: self.Info[questID] = popup Nenue@45: self.WatchInfo[index] = popup Nenue@29: Nenue@29: Nenue@29: return self.Info[questID] Nenue@29: end Nenue@29: Nenue@28: AutoQuest.UpdateObjectives = function(handler, block) Nenue@28: local print = lprint Nenue@28: if block.info.type == 'OFFER' then Nenue@29: block.status:SetText(T.strings.CLICK_TO_ACCEPT) Nenue@28: end Nenue@28: end Nenue@28: Nenue@31: AutoQuest.Select = function(handler, block) Nenue@28: Nenue@31: if block.info.popupType == 'OFFER' then Nenue@34: ShowQuestOffer(block.info.logIndex) Nenue@28: else Nenue@34: ShowQuestComplete(block.info.logIndex) Nenue@28: end Nenue@31: RemoveAutoQuestPopUp(block.info.questID) Nenue@28: end Nenue@28: Nenue@28: AutoQuest.Link = T.Quest.Link