Mercurial > wow > buffalo2
comparison ObjectiveTracker/AutoQuestPopupData.lua @ 43:9480bd904f4c
- file name organizing
| author | Nenue |
|---|---|
| date | Mon, 25 Apr 2016 13:51:58 -0400 |
| parents | ObjectiveTracker/AutoQuestPopups.lua@e84d645c8ab8 |
| children | dd1ae565f559 |
comparison
equal
deleted
inserted
replaced
| 42:c73051785f19 | 43:9480bd904f4c |
|---|---|
| 1 --- ${PACKAGE_NAME} | |
| 2 -- @file-author@ | |
| 3 -- @project-revision@ @project-hash@ | |
| 4 -- @file-revision@ @file-hash@ | |
| 5 -- Created: 4/13/2016 7:49 PM | |
| 6 local B = select(2,...).frame | |
| 7 local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') | |
| 8 local print = B.print('Info') | |
| 9 local lprint = B.print('Line') | |
| 10 local AutoQuest, Quest = T.AutoQuest, T.Quest | |
| 11 local ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp = ShowQuestOffer, ShowQuestComplete, RemoveAutoQuestPopUp | |
| 12 local GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle = GetNumAutoQuestPopUps, GetAutoQuestPopUp, GetQuestLogIndexByID, GetQuestLogTitle | |
| 13 --- Data retrieval | |
| 14 function AutoQuest:GetNumWatched () | |
| 15 if true then return 0, 0, nil end | |
| 16 print(self.name, self) | |
| 17 --Quest:GetNumWatched() | |
| 18 self.numWatched = GetNumAutoQuestPopUps() | |
| 19 | |
| 20 return self.numWatched | |
| 21 end | |
| 22 AutoQuest.GetInfo = function(self, popupIndex) | |
| 23 | |
| 24 | |
| 25 local questID, type = GetAutoQuestPopUp(popupIndex) | |
| 26 local questLogIndex = GetQuestLogIndexByID(questID) | |
| 27 local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questLogIndex) | |
| 28 | |
| 29 self.Info[questID] = self.Info[questID] or {} | |
| 30 local popup = self.Info[questID] | |
| 31 popup.questID = questID | |
| 32 popup.id = questID | |
| 33 popup.title = title | |
| 34 popup.description = type | |
| 35 popup.popupType = type | |
| 36 popup.logIndex = questLogIndex | |
| 37 popup.popupIndex = popupIndex | |
| 38 | |
| 39 self.Info[questID] = popup | |
| 40 self.WatchInfo[popupIndex] = popup | |
| 41 | |
| 42 | |
| 43 return self.Info[questID] | |
| 44 end | |
| 45 | |
| 46 AutoQuest.UpdateObjectives = function(handler, block) | |
| 47 local print = lprint | |
| 48 if block.info.type == 'OFFER' then | |
| 49 block.status:SetText(T.strings.CLICK_TO_ACCEPT) | |
| 50 end | |
| 51 end | |
| 52 | |
| 53 AutoQuest.Select = function(handler, block) | |
| 54 | |
| 55 if block.info.popupType == 'OFFER' then | |
| 56 ShowQuestOffer(block.info.logIndex) | |
| 57 else | |
| 58 ShowQuestComplete(block.info.logIndex) | |
| 59 end | |
| 60 RemoveAutoQuestPopUp(block.info.questID) | |
| 61 end | |
| 62 | |
| 63 AutoQuest.Link = T.Quest.Link |
