From 47ffb2c4452b074a42296ed38c158db187474111 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Wed, 1 Dec 2010 22:56:43 +0000 Subject: [PATCH] Find the first objective in the watch list If the first quest does not have an objective that can be tracked, as in it does not have an objective number next to it, it will find the first objective that DOES exist and use that for the quest arrow. --- TomTomLite.lua | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/TomTomLite.lua b/TomTomLite.lua index e447dde..103df50 100644 --- a/TomTomLite.lua +++ b/TomTomLite.lua @@ -149,26 +149,37 @@ local function findQuestFrameFromQuestIndex(index) end function addon:Scan() - -- Get the first quest item in the watch frame - local questIndex = GetQuestIndexForWatch(1) - if not questIndex then - self.arrow:Hide() - return - end + QuestPOIUpdateIcons() - local title = GetQuestLogTitle(questIndex) - local qid = select(9, GetQuestLogTitle(questIndex)) + local watchIndex = 1 + while true do + -- Get the first quest item in the watch frame + local questIndex = GetQuestIndexForWatch(watchIndex) + if not questIndex then + self.arrow:Hide() + return + end - QuestPOIUpdateIcons() - local completed, x, y, objective = QuestPOIGetIconInfo(qid) - local map, floor = GetCurrentMapAreaID() + local title = GetQuestLogTitle(questIndex) + local qid = select(9, GetQuestLogTitle(questIndex)) - if not floor then floor = 0 end - if completed then - title = "Turn in: " .. title - end + local completed, x, y, objective = QuestPOIGetIconInfo(qid) + + -- Check to see if there was coordinate information for the current point + if x and y then + local map, floor = GetCurrentMapAreaID() + + if not floor then floor = 0 end + if completed then + title = "Turn in: " .. title + end + + if x and y and map and floor then + self:AddWaypoint(map, floor, x, y, {title = title}) + end + return + end - if x and y and map and floor then - self:AddWaypoint(map, floor, x, y, {title = title}) + watchIndex = watchIndex + 1 end end -- 1.7.9.5