Mercurial > wow > buffalo2
diff ObjectiveTracker/AutoQuestPopups.lua @ 29:adcd7c328d07
code collation cleaning
author | Nenue |
---|---|
date | Wed, 13 Apr 2016 21:53:24 -0400 |
parents | c33c17dd97e7 |
children | 7583684becf4 |
line wrap: on
line diff
--- a/ObjectiveTracker/AutoQuestPopups.lua Wed Apr 13 20:19:37 2016 -0400 +++ b/ObjectiveTracker/AutoQuestPopups.lua Wed Apr 13 21:53:24 2016 -0400 @@ -5,19 +5,46 @@ -- Created: 4/13/2016 7:49 PM local B = select(2,...).frame local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') -local _G, ipairs, max, min, unpack, floor, pairs, tostring, type, band = _G, ipairs, max, min, unpack, floor, pairs, tostring, type, bit.band +local print = B.print('Info') +local lprint = B.print('Line') +local AutoQuest, Quest = T.AutoQuest, T.Quest local ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp = ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp -local lprint = B.print('Line') -local AutoQuest = T.AutoQuest +local GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle = GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle +--- Data retrieval +function AutoQuest:GetNumWatched () + print(self.name, self) + Quest:GetNumWatched() + self.numWatched = GetNumAutoQuestPopUps() ---- They are not exactly quests, but the aliases used to signal that a quest was pushed into your log by the environment. --- Once accepted they never appear again unless the quest is dropped (daily reset/abandon quest) -local CLICK_TO_COMPLETE = 'Click to Complete' -local CLICK_TO_ACCEPT = 'Click to Accept' + return self.numWatched +end +AutoQuest.GetInfo = function(self, popupIndex) + + + local questID, type = GetAutoQuestPopUp(popupIndex) + local questLogIndex = GetQuestLogIndexByID(questID) + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questLogIndex) + + self.Info[questID] = self.Info[questID] or {} + local popup = self.Info[questID] + popup.title = title + popup.description = type + popup.popupType = type + popup.questID = questID + popup.questLogIndex = questLogIndex + popup.popupIndex = popupIndex + + self.Info[questID] = popup + self.WatchInfo[popupIndex] = popup + + + return self.Info[questID] +end + AutoQuest.UpdateObjectives = function(handler, block) local print = lprint if block.info.type == 'OFFER' then - block.status:SetText(CLICK_TO_ACCEPT) + block.status:SetText(T.strings.CLICK_TO_ACCEPT) end end