From 1eddc11d4bec1cc2fac1b73d76302b1c8dc23abe Mon Sep 17 00:00:00 2001 From: Tekkub Stoutwrithe Date: Wed, 22 Aug 2007 09:59:30 +0000 Subject: [PATCH] TourGuide - Repositioned frame default to be more friendly to the default UI - Changed to use tekDebug... I need to import that... - Added lots of debug output - Maybe I fixed early turnin of chain quests, maybe I didn't... fuck if I know. Gotta keep leveling till I get another one to test on. git-svn-id: https://tekkub-wow.googlecode.com/svn/trunk/TourGuide@489 86fe6d9a-1522-0410-a387-bf9db416f0a0 --- Horde/13_20_Ghostlands.lua | 13 ++++++------ QuestTracking.lua | 52 +++++++++++++++++++++++++--------------------- StatusFrame.lua | 2 +- TourGuide.lua | 19 +++++++++++++---- TourGuide.toc | 3 +-- 5 files changed, 51 insertions(+), 38 deletions(-) diff --git a/Horde/13_20_Ghostlands.lua b/Horde/13_20_Ghostlands.lua index 349a2f8..b661197 100644 --- a/Horde/13_20_Ghostlands.lua +++ b/Horde/13_20_Ghostlands.lua @@ -55,15 +55,15 @@ T Anok'suten A Goldenmist Village C Down the Dead Scar |N|To the west| -C Salvaging the Past -C Culinary Crunch +C Salvaging the Past |N|Around (34,34)| C Tomber's Supplies |N|In a cart (33,26)| -C Investigate An'daroth +C Investigate An'daroth |N|Around (37,15)| C Goldenmist Village -C The Plagued Coast -C Curbing the Plague +C The Plagued Coast |N|On the coast west of Goldenmist Village| +C Curbing the Plague |N|Down the coast (24,38)| +C Culinary Crunch |N|Kill more spiders if you didn't get enough| -A Underlight Ore Samples |N|Grind mobs on your way (31,48| +A Underlight Ore Samples |N|Grind mobs on your way (31,48)| C Trouble at the Underlight Mines C Underlight Ore Samples @@ -73,7 +73,6 @@ T Trouble at the Underlight Mines T Culinary Crunch T Tomber's Supplies T Investigate An'daroth -T Curbing the Plague T Salvaging the Past T Goldenmist Village T The Plagued Coast diff --git a/QuestTracking.lua b/QuestTracking.lua index c6a3846..6e6738f 100644 --- a/QuestTracking.lua +++ b/QuestTracking.lua @@ -48,34 +48,25 @@ function TourGuide:CHAT_MSG_SYSTEM(event, msg) end self:Debug(1, "Detected early turnin, searching for quest...") - local i = self.current + 1 - repeat - action, quest, note, logi, complete, hasitem, turnedin, fullquestname = self:GetObjectiveInfo(i) - if action == "TURNIN" and not turnedin and text == quest:gsub("%s%(Part %d+%)", "") then - self:DebugF(1, "Saving early quest turnin %q", quest) - return self:SetTurnedIn(i, true) - end - i = i + 1 - until not action - self:DebugF(1, "Quest %q not found!", text) + self:CompleteQuest(text) end function TourGuide:QUEST_COMPLETE(event) - local action, quest, note, logi, complete, hasitem, turnedin = self:GetCurrentObjectiveInfo() - if (action == "TURNIN" or action == "ITEM") and logi then hadquest = quest - else hadquest = nil end + self:DebugF(1, "Quest Complete %q", GetTitleText()) +--~ hadquest = GetTitleText() +--~ local action, quest, note, logi, complete, hasitem, turnedin = self:GetCurrentObjectiveInfo() +--~ if (action == "TURNIN" or action == "ITEM") and logi then hadquest = quest +--~ else hadquest = nil end end function TourGuide:UNIT_QUEST_LOG_UPDATE(event, unit) if unit ~= "player" or not hadquest then return end + self:Debug(1, "Unit quest log update") local action, quest, note, logi, complete, hasitem, turnedin = self:GetCurrentObjectiveInfo() - if hadquest == quest and action == "ITEM" and not logi then - self:DebugF(1, "Chain turnin detected, %q - %q", action, quest) - self:SetTurnedIn() - elseif hadquest == quest and not logi then + if hadquest == quest and not logi then self:DebugF(1, "Chain turnin detected, %q - %q", action, quest) self:UpdateStatusFrame() end @@ -90,18 +81,31 @@ end local turninquest function TourGuide:QUEST_FINISHED() - local action, quest, note, logi, complete, hasitem, turnedin = self:GetCurrentObjectiveInfo() - if action == "TURNIN" and logi then turninquest = quest - else turninquest = nil end + local quest = GetTitleText() + self:DebugF(1, "Quest Finished %q", quest) + if self:GetQuestLogIndexByName(quest) then + self:DebugF(1, "Player has quest %q, turning in?", quest) + turninquest = quest + end +--~ local action, quest, note, logi, complete, hasitem, turnedin = self:GetCurrentObjectiveInfo() +--~ if action == "TURNIN" and logi then turninquest = quest +--~ else turninquest = nil end end function TourGuide:QUEST_LOG_UPDATE(event) + self:Debug(1, "Quest log update") local action, quest, note, logi, complete, hasitem, turnedin, fullquestname = self:GetCurrentObjectiveInfo() - - if action == "ACCEPT" then return self:UpdateStatusFrame() - elseif action == "TURNIN" and turninquest == quest and not logi then return self:SetTurnedIn() - elseif action == "COMPLETE" and complete then return self:UpdateStatusFrame() end + local questturnedin = turninquest and not self:GetQuestLogIndexByName(turninquest) + if turninquest then self:DebugF(1, "Turned in quest %q", turninquest) end + + if questturnedin then + self:Debug(1, "Detected early chain quest turnin, searching for quest...") + self:CompleteQuest(turninquest) + elseif action == "ACCEPT" then self:UpdateStatusFrame() + elseif action == "TURNIN" and turninquest == quest and not logi then self:SetTurnedIn() + elseif action == "COMPLETE" and complete then self:UpdateStatusFrame() end + turninquest = nil end diff --git a/StatusFrame.lua b/StatusFrame.lua index 0cbecc8..8b33127 100644 --- a/StatusFrame.lua +++ b/StatusFrame.lua @@ -6,7 +6,7 @@ local ww = WidgetWarlock local f = CreateFrame("Button", nil, UIParent) -f:SetPoint("BOTTOMRIGHT", QuestWatchFrame, "TOPRIGHT", 0, 10) +f:SetPoint("BOTTOMRIGHT", QuestWatchFrame, "TOPRIGHT", 0, -15) f:SetHeight(32) f:EnableMouse(true) f:RegisterForDrag("LeftButton") diff --git a/TourGuide.lua b/TourGuide.lua index 0ee111f..74acd86 100644 --- a/TourGuide.lua +++ b/TourGuide.lua @@ -3,11 +3,9 @@ local OptionHouse = DongleStub("OptionHouse-1.0") local myfaction = UnitFactionGroup("player") -local debugframe = TourGuideOHDebugFrame -TourGuideOHDebugFrame = nil TourGuide = DongleStub("Dongle-1.0"):New("TourGuide") -TourGuide:EnableDebug(1, debugframe) +if tekDebug then TourGuide:EnableDebug(1, tekDebug:GetFrame("TourGuide")) end TourGuide.guides = {} TourGuide.guidelist = {} TourGuide.nextzones = {} @@ -71,7 +69,6 @@ function TourGuide:Enable() local oh = OptionHouse:RegisterAddOn("Tour Guide", title, author, version) oh:RegisterCategory("Guides", TourGuide, "CreateGuidesPanel") oh:RegisterCategory("Objectives", TourGuide, "CreateObjectivePanel") - oh:RegisterCategory("Debug", function() return debugframe end) for _,event in pairs(self.TrackEvents) do self:RegisterEvent(event) end self.TrackEvents = nil @@ -232,3 +229,17 @@ function TourGuide:SetTurnedIn(i, value) self:DebugF(1, "Set turned in %q = %s", self.quests[i], tostring(value)) self:UpdateStatusFrame() end + + +function TourGuide:CompleteQuest(name) + local i = self.current + 1 + repeat + action, quest, note, logi, complete, hasitem, turnedin, fullquestname = self:GetObjectiveInfo(i) + if action == "TURNIN" and not turnedin and name == quest:gsub("%s%(Part %d+%)", "") then + self:DebugF(1, "Saving early quest turnin %q", quest) + return self:SetTurnedIn(i, true) + end + i = i + 1 + until not action + self:DebugF(1, "Quest %q not found!", name) +end diff --git a/TourGuide.toc b/TourGuide.toc index 468d91c..cb7de7f 100644 --- a/TourGuide.toc +++ b/TourGuide.toc @@ -8,13 +8,12 @@ ## SavedVariables: TourGuideAlphaDB -## OptionalDeps: Dongle, Optionhouse, TomTom +## OptionalDeps: Dongle, Optionhouse, TomTom, tekErr Dongle.lua OptionHouse.lua WidgetWarlock.lua -OHDebug.lua TourGuide.lua StatusFrame.lua OHFrame.lua -- 2.11.4.GIT