Mercurial > wow > buffalo2
comparison ObjectiveInfo.lua @ 1:b0447b382f36
sorting client events from maintenance logic
implemented all that action buttons entail for quest items
| author | Nenue |
|---|---|
| date | Wed, 30 Mar 2016 16:30:49 -0400 |
| parents | 3dbcad2b387d |
| children | a2396b03ce63 |
comparison
equal
deleted
inserted
replaced
| 0:3dbcad2b387d | 1:b0447b382f36 |
|---|---|
| 7 | 7 |
| 8 local Tracker, AutoQuest, Quest, Cheevs = mod.Tracker, mod.AutoQuest, mod.Quest, mod.Cheevs | 8 local Tracker, AutoQuest, Quest, Cheevs = mod.Tracker, mod.AutoQuest, mod.Quest, mod.Cheevs |
| 9 -------------------------------------------------------------------- | 9 -------------------------------------------------------------------- |
| 10 --- Tracker-specific data retrieval functions | 10 --- Tracker-specific data retrieval functions |
| 11 -------------------------------------------------------------------- | 11 -------------------------------------------------------------------- |
| 12 | 12 Quest.itemButtons = {} |
| 13 Quest.freeButtons = {} | |
| 14 Quest.POI = {} | |
| 13 Quest.GetNumWatched = function() | 15 Quest.GetNumWatched = function() |
| 14 return GetNumQuestWatches () | 16 return GetNumQuestWatches () |
| 15 end | 17 end |
| 16 Quest.GetInfo = function (self, watchIndex) | 18 Quest.GetInfo = function (self, watchIndex) |
| 17 print('|cFF00DDFFQuest|r.|cFF0088FFGetInfo(|r'.. tostring(watchIndex)..'|r)') | 19 print('|cFF00DDFFQuest|r.|cFF0088FFGetInfo(|r'.. tostring(watchIndex)..'|r)') |
| 18 local questID, title, questLogIndex, numObjectives, requiredMoney, isComplete, | 20 local questID, title, questIndex, numObjectives, requiredMoney, isComplete, |
| 19 startEvent, isAutoComplete, failureTime, timeElapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(watchIndex) | 21 startEvent, isAutoComplete, failureTime, timeElapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(watchIndex) |
| 20 print(GetQuestWatchInfo(watchIndex)) | 22 print(GetQuestWatchInfo(watchIndex)) |
| 21 if not questID then | 23 if not questID then |
| 22 return | 24 return |
| 23 end | 25 end |
| 27 local q = self.Info[questID] | 29 local q = self.Info[questID] |
| 28 q.watchIndex = watchIndex | 30 q.watchIndex = watchIndex |
| 29 q.type = 'Quest' | 31 q.type = 'Quest' |
| 30 q.questID = questID | 32 q.questID = questID |
| 31 q.title = title | 33 q.title = title |
| 32 q.questLogIndex = questLogIndex | 34 q.questLogIndex = questIndex |
| 33 q.numObjectives = numObjectives | 35 q.numObjectives = numObjectives |
| 34 q.requiredMoney = requiredMoney | 36 q.requiredMoney = requiredMoney |
| 35 q.isComplete = isComplete | 37 q.isComplete = isComplete |
| 36 q.startEvent = startEvent | 38 q.startEvent = startEvent |
| 37 q.isAutoComplete = isAutoComplete | 39 q.isAutoComplete = isAutoComplete |
| 43 q.isOnMap = isOnMap | 45 q.isOnMap = isOnMap |
| 44 q.hasLocalPOI = hasLocalPOI | 46 q.hasLocalPOI = hasLocalPOI |
| 45 | 47 |
| 46 --- Start QuestLogEntry calls | 48 --- Start QuestLogEntry calls |
| 47 ----------------------------------------- | 49 ----------------------------------------- |
| 48 SelectQuestLogEntry(questLogIndex) | 50 SelectQuestLogEntry(questIndex) |
| 49 q.greenRange = GetQuestGreenRange() | 51 q.greenRange = GetQuestGreenRange() |
| 50 q.isDaily = QuestIsDaily() | 52 q.isDaily = QuestIsDaily() |
| 51 q.isWeekly = QuestIsWeekly() | 53 q.isWeekly = QuestIsWeekly() |
| 52 ----------------------------------------- | 54 ----------------------------------------- |
| 53 | 55 |
| 55 print(' |cFF0088FF', q.isDaily, q.isWeekly) | 57 print(' |cFF0088FF', q.isDaily, q.isWeekly) |
| 56 | 58 |
| 57 q.isComplete = IsQuestComplete(questID) | 59 q.isComplete = IsQuestComplete(questID) |
| 58 q.isBreadCrumb = IsBreadcrumbQuest(questID) | 60 q.isBreadCrumb = IsBreadcrumbQuest(questID) |
| 59 q.isStoryQuest = IsStoryQuest(questID) | 61 q.isStoryQuest = IsStoryQuest(questID) |
| 60 q.completionText= GetQuestLogCompletionText(questLogIndex) | 62 q.completionText= GetQuestLogCompletionText(questIndex) |
| 61 q.trackingID = questID | 63 q.trackingID = questID |
| 62 q.superTracked = (questID == GetSuperTrackedQuestID()) -- call directly so artifact data doesn't become an issue | 64 q.superTracked = (questID == GetSuperTrackedQuestID()) -- call directly so artifact data doesn't become an issue |
| 63 q.numObjectives = GetNumQuestLeaderBoards(questLogIndex) | 65 q.numObjectives = GetNumQuestLeaderBoards(questIndex) |
| 66 q.isWatched = IsQuestWatched(questIndex) | |
| 64 q.objectives = {} | 67 q.objectives = {} |
| 65 for i = 1, q.numObjectives do | 68 for i = 1, q.numObjectives do |
| 66 local text, type, finished = GetQuestLogLeaderBoard(i, questLogIndex) | 69 local text, type, finished = GetQuestLogLeaderBoard(i, questIndex) |
| 67 q.objectives[i] = { | 70 q.objectives[i] = { |
| 68 type = type, | 71 type = type, |
| 69 text = text, | 72 text = text, |
| 70 finished = finished | 73 finished = finished |
| 71 } | 74 } |
| 75 elseif type == 'reputation' then | 78 elseif type == 'reputation' then |
| 76 elseif type == 'item' then | 79 elseif type == 'item' then |
| 77 end | 80 end |
| 78 end | 81 end |
| 79 | 82 |
| 80 local link, icon, charges = GetQuestLogSpecialItemInfo(questLogIndex) | 83 local link, icon, charges = GetQuestLogSpecialItemInfo(questIndex) |
| 81 local start, duration, enable = GetQuestLogSpecialItemCooldown(questLogIndex) | 84 local start, duration, enable = GetQuestLogSpecialItemCooldown(questIndex) |
| 82 if link or icon or charges then | 85 if link or icon or charges then |
| 83 q.specialItem = { | 86 q.specialItem = { |
| 87 questID = questID, | |
| 88 questIndex = questIndex, | |
| 84 link = link, | 89 link = link, |
| 85 charges = charges, | 90 charges = charges, |
| 86 icon = icon, | 91 icon = icon, |
| 87 start = start, | 92 start = start, |
| 88 duration = duration, | 93 duration = duration, |
| 89 enable = enable, | 94 enable = enable, |
| 90 } | 95 } |
| 91 end | 96 end |
| 92 | 97 |
| 93 self.LogInfo[questLogIndex] = q | 98 |
| 94 print('|cFF0088FFGetQuestInfo('..questID..')|r', questLogIndex, title) | 99 if QuestHasPOIInfo(questID) then |
| 100 local distance, onContinent = GetDistanceSqToQuest(questIndex) | |
| 101 if distance ~= nil and distance > 0 then | |
| 102 self.POI[questIndex] = { | |
| 103 questIndex = questIndex, | |
| 104 questID = questID, | |
| 105 distance = distance, | |
| 106 onContinent = onContinent | |
| 107 } | |
| 108 end | |
| 109 end | |
| 110 | |
| 111 self.LogInfo[questIndex] = q | |
| 112 print('|cFF0088FFGetQuestInfo('..questID..')|r', questIndex, title) | |
| 95 return q | 113 return q |
| 114 end | |
| 115 | |
| 116 Quest.GetClosest = function() | |
| 117 local minID | |
| 118 local minDist = math.huge | |
| 119 for i = 1, Quest.GetNumWatched() do | |
| 120 local info = Quest.GetInfo(i) | |
| 121 if info.hasLocalPOI then | |
| 122 local distance, onContinent = GetDistanceSqToQuest(info.questIndex) | |
| 123 end | |
| 124 end | |
| 96 end | 125 end |
| 97 | 126 |
| 98 Cheevs.GetNumWatched = function(self) | 127 Cheevs.GetNumWatched = function(self) |
| 99 Cheevs.trackedCheevs = {GetTrackedAchievements()} | 128 Cheevs.trackedCheevs = {GetTrackedAchievements()} |
| 100 return GetNumTrackedAchievements() | 129 return GetNumTrackedAchievements() |
