From e55b5b0d4763f9389bd523e0ffd5894e73880d0d Mon Sep 17 00:00:00 2001 From: Tekkub Stoutwrithe Date: Thu, 9 Aug 2007 09:10:57 +0000 Subject: [PATCH] TourGuide - Guide selector works, yatta! - New horde data, more to come - Added more fades. Users are stupid, they like fades. - Some more failsafes for bad guide data - Fixed bugs in alliance guide data git-svn-id: https://tekkub-wow.googlecode.com/svn/trunk/TourGuide@473 86fe6d9a-1522-0410-a387-bf9db416f0a0 --- Alliance/01_06_Shadowglen.lua | 2 +- Alliance/06_12_Teldrassil.lua | 2 +- Alliance/38_40_Stranglethorn.lua | 6 +- Horde/26_27_Ashenvale.lua | 54 ++++++++++++ Horde/27_29_ThousandNeedles.lua | 76 +++++++++++++++++ Horde/27_StonetalonMountains.lua | 13 +++ OHFrame.lua | 76 ++++++++++++----- OHGuides.lua | 179 ++++++++++++++++++++++----------------- StatusFrame.lua | 5 +- TourGuide.lua | 29 +++++-- TourGuide.toc | 9 ++ 11 files changed, 334 insertions(+), 117 deletions(-) create mode 100644 Horde/26_27_Ashenvale.lua create mode 100644 Horde/27_29_ThousandNeedles.lua create mode 100644 Horde/27_StonetalonMountains.lua rewrite OHGuides.lua (65%) diff --git a/Alliance/01_06_Shadowglen.lua b/Alliance/01_06_Shadowglen.lua index 17dcdac..9e5b684 100644 --- a/Alliance/01_06_Shadowglen.lua +++ b/Alliance/01_06_Shadowglen.lua @@ -1,5 +1,5 @@ -TourGuide:RegisterGuide("Shadownglen (1-6)", "Teldrassil (6-12)", "Alliance", function() +TourGuide:RegisterGuide("Shadowglen (1-6)", "Teldrassil (6-12)", "Alliance", function() return [[ A The Balance of Nature (Part 1) C The Balance of Nature (Part 1) diff --git a/Alliance/06_12_Teldrassil.lua b/Alliance/06_12_Teldrassil.lua index 7420660..3e6b8b4 100644 --- a/Alliance/06_12_Teldrassil.lua +++ b/Alliance/06_12_Teldrassil.lua @@ -38,7 +38,7 @@ T Gnarlpine Corruption |N|In the tower| A The Relics of Wakening T The Emerald Dreamcatcher A Ferocitas the Dream Eater -r Train (Level 8) +t Train (Level 8) C Seek Redemption! T Seek Redemption! diff --git a/Alliance/38_40_Stranglethorn.lua b/Alliance/38_40_Stranglethorn.lua index 6deb235..6f27957 100644 --- a/Alliance/38_40_Stranglethorn.lua +++ b/Alliance/38_40_Stranglethorn.lua @@ -7,7 +7,7 @@ A Scaring Shaky |N|In the building next to the upside down half boat| h Booty Bay A Venture Company Mining T The Rumormonger |N|Upstairs| -A Dream Dust In the Swamp +A Dream Dust in the Swamp A Skullsplitter Tusks T Sunken Treasure (Part 4) |N|Skip the next part| @@ -18,14 +18,14 @@ C Water Elementals |N|On the island (20,23)| G Grind to level 39 |N|These elementals or raptors and basalisks around (33,39)| G Grind east, past the road |N|To (41,41)| C Venture Company Mining -C Skullsplitter Tusks |N|In the camps around (42,37) +C Skullsplitter Tusks |N|In the camps around (42,37)| C Panther Mastery (Part 4) |N|Bhag'thera is anywhere between just north of Mosh’ogg (49,25) to just north of the ZG entrance (48,17)| H Booty Bay T Venture Company Mining T Skullsplitter Tusks |N|Upstairs| T Water Elementals |N|Skip next part| -T Some assembly required +T Some Assembly Required A Excelsior T The Bloodsail Buccaneers (Part 1) |N|Run out of BB, then West. Letter on a barrel in the pirate camp (27,69)| diff --git a/Horde/26_27_Ashenvale.lua b/Horde/26_27_Ashenvale.lua new file mode 100644 index 0000000..fa188c7 --- /dev/null +++ b/Horde/26_27_Ashenvale.lua @@ -0,0 +1,54 @@ + +TourGuide:RegisterGuide("Ashenvale (26-27)", "Stonetalon Mountains (27)", "Horde", function() +return [[ +h Splintertree Post +A Stonetalon Standstill +A Satyr Horns +A Ashenvale Outrunners |N|Started by Kuray'bin (71,68)| +T The Ashenvale Hunt + +N Kill Sharptalon |N|Spawns around (74,70). Bringing him to 1/3 health than dragging him over to the guards should help.| +C Ashenvale Outrunners +T Ashenvale Outrunners + +A Torek's Assault |N|Started by Torek (68,75)| +C Torek's Assault +C Stonetalon Standstill |N|Also find and kill Tideress he drops an item which starts The Befouled Element| +N Kill Ursangous |N|Spawns around (42,67), for the Ashenvale Hunt| +N Kill Shadumbra |N|Spawns around (56,54), for the Ashenvale Hunt| +C The Sacred Flame |N|Get a phial from killing a dryad at (61,52) and fill it at the moonwell at (60,72)| + +H Splintertree Post +T Stonetalon Standstill +I The Befouled Element |I|16408| +A Je'neu of the Earthern Ring +T Torek's Assault +I Sharptalon's Claw |I|16305| +I Ursangous's Paw |I|16305| +I Shadumbra's Head |I|16304| +A The Hunt Completed +T The Hunt Completed + +F Zoram Strand +T Je'neu of the Earthern Ring +A Between a Rock and a Thistlefur +A Troll Charm + +C Between a Rock and a Thistlefur +C Troll Charm |N|Cave is at back of the camp (38,30)| +T Between a Rock and a Thistlefur +T Troll Charm +G Grind to 27 |N|If you're not already| + +A Destroy the Legion +C Ordanus |N|Fight to top room. Just kill Ordanus, loot the head then jump out of there.| +C Satyr Horns |N|Most annoying quest ever if you can't remove curse.| +C Destroy the Legion + +R Splintertree Post |N|Don't hearth| +T Satyr Horns +T Destroy the Legion +I Diabolical Plans |I|23797| +]] +end) + diff --git a/Horde/27_29_ThousandNeedles.lua b/Horde/27_29_ThousandNeedles.lua new file mode 100644 index 0000000..5e37aed --- /dev/null +++ b/Horde/27_29_ThousandNeedles.lua @@ -0,0 +1,76 @@ + +TourGuide:RegisterGuide("Thousand Needles (27-29)", nil, "Horde", function() +return [[ +F Thousand Needles +T The Sacred Flame (Part 2) +A The Sacred Flame (Part 3) +A A Differend Approach + +C The Scared Flame |N|Charge the brazier in the cave at (44,37)| +N Kill Galak Messenger |N|If you come across him.| + +R Whitereach Post +A Hypercapacitor Gizmo +T Serpent Wild +A Sacred Fire + +C Sacred Fire +C Wind Rider +C Homeward Bound |N|Escort starts at (16,42) if elite gets in the way, skip it| +C Steelsnap +C A Different Approach + +H Sun Rock Retreat +F Thunder Bluff +t Train (Level 28) +T Steelsnap |N|Hunter Rise| +A Frostmaw +T Sacred Fire |N|Elder Rise| +A Arikara + +F Freewind Post +h Freewind Post +T The Sacred Flame (Part 3) +T Wind Rider + +R Darkcloud Pinniacle |N|Entrance ramp is at (31,36)| +C Grimtotem Spying |N|The notes are up on the rises at (31,32) (33,39) and (39,41)| +C Arikara +C Wanted - Arnak Grimtotem |N|He is up at (38,27)| +A Free at Last |N| Escort Lakota Windsong (38,27)| +C Free at Last + +R Whitereach Post +T Arikara +T Homeward Bound +T A Different Approach +A A Dip in the Moonwell + +C A Dip in the Moonwell |N|Control console is at (9,18) If you have a pet you will have to dismiss it before you can control the robot.| +G Grind to level 29 |N|If you're not already. Also, kill Galak Messenger if you've not yet.| +C Hypercapacitor Gizmo |N|Cage is at (22,24)| + +I Assassination Plot |I|12564| +T Hypercapacitor Gizmo +T A Dip in the Moonwell +A Testing the Tonic +A Protect Kanati Greycloud +C Protect Kanati Greycloud +T Protect Kanati Greycloud + +H Freewind Post +T Free at Last +T Wanted - Arnak Grimtotem +T Grimtotem Spying +T Testing the Tonic + +F Orgrimmar +h Orgrimmar +F Undercity |N|Take zeppelin outside Orgrimmar| +R Tarren Mill |N|in Hillsbrad Foothills. Go out undercity sewers its quicker.| +]] +end) + + + + diff --git a/Horde/27_StonetalonMountains.lua b/Horde/27_StonetalonMountains.lua new file mode 100644 index 0000000..64fb785 --- /dev/null +++ b/Horde/27_StonetalonMountains.lua @@ -0,0 +1,13 @@ + +TourGuide:RegisterGuide("Stonetalon Mountains (27)", "Thousand Needles (27-29)", "Horde", function() +return [[ +F Sun Rock Retreat +T Ordanus |N|Skip "The Den"| +h Sun Rock Retreat +A Bloodfury Bloodline |N|Kill Bloodfury Ripper (30,63), grinding along the way.| +H Sun Rock Retreat +F Thunder Bluff +T The Sacred Flame (Part 1) |N|(54,51)| +A The Sacred Flame (Part 2) +]] +end) \ No newline at end of file diff --git a/OHFrame.lua b/OHFrame.lua index 16e97d3..56756e3 100644 --- a/OHFrame.lua +++ b/OHFrame.lua @@ -9,7 +9,9 @@ local ROWOFFSET = 4 local NUMROWS = math.floor(305/(ROWHEIGHT+4)) -local offset = 0 +local offset, elapsed = 0, 0 +local rows = {} +local frame, fader local function OnShow() @@ -17,16 +19,29 @@ local function OnShow() if offset < 0 then offset = 0 elseif (offset + NUMROWS) > #TourGuide.actions then offset = #TourGuide.actions - NUMROWS end TourGuide:UpdateOHPanel() + + frame:SetAlpha(0) + elapsed = 0 + fader:Show() end function TourGuide:CreateObjectivePanel() - local frame = ww.SummonOptionHouseBaseFrame() + fader = CreateFrame("Frame") + fader:Hide() + fader:SetScript("OnUpdate", function(self, elap) + elapsed = elapsed + elap + if elapsed > 1 then + self:Hide() + frame:SetAlpha(1) + else frame:SetAlpha(elapsed) end + end) + + frame = ww.SummonOptionHouseBaseFrame() - frame.rows = {} for i=1,NUMROWS do local row = CreateFrame("Button", nil, frame) - row:SetPoint("TOPLEFT", i == 1 and frame or frame.rows[i-1], i == 1 and "TOPLEFT" or "BOTTOMLEFT", 0, -ROWOFFSET) + row:SetPoint("TOPLEFT", i == 1 and frame or rows[i-1], i == 1 and "TOPLEFT" or "BOTTOMLEFT", 0, -ROWOFFSET) row:SetWidth(630) row:SetHeight(ROWHEIGHT) @@ -44,18 +59,17 @@ function TourGuide:CreateObjectivePanel() row.detail = detail row.check = check row.icon = icon - frame.rows[i] = row + rows[i] = row end frame:EnableMouseWheel() frame:SetScript("OnMouseWheel", function(f, val) offset = offset - val - if offset < 0 then offset = 0 - elseif (offset + NUMROWS) > #self.actions then offset = #self.actions - NUMROWS end + if (offset + NUMROWS) > #self.actions then offset = #self.actions - NUMROWS end + if offset < 0 then offset = 0 end self:UpdateOHPanel() end) - self.OHFrame = frame frame:SetScript("OnShow", OnShow) OnShow() return frame @@ -64,27 +78,43 @@ end local accepted = {} function TourGuide:UpdateOHPanel() - if not self.OHFrame or not self.OHFrame:IsVisible() then return end + if not frame or not frame:IsVisible() then return end for i in pairs(accepted) do accepted[i] = nil end - for i,row in ipairs(self.OHFrame.rows) do - row.i = i + offset + for i=1,offset-1 do local action, name, note, logi, complete, hasitem, turnedin, fullquestname = self:GetObjectiveInfo(i + offset) - local shortname = name:gsub("%s%(Part %d+%)", "") - logi = not turnedin and (accepted[name] or not accepted[shortname]) and logi - complete = not turnedin and (accepted[name] or not accepted[shortname]) and complete - local checked = turnedin or action == "ACCEPT" and logi or action == "COMPLETE" and complete - - if action == "ACCEPT" and logi then - accepted[name] = true - accepted[shortname] = true + if name then + local shortname = name:gsub("%s%(Part %d+%)", "") + if action == "ACCEPT" and not turnedin and (accepted[name] or not accepted[shortname]) then + accepted[name] = true + accepted[shortname] = true + end end + end - row.icon:SetTexture(self.icons[action]) - row.text:SetText(name) - row.detail:SetText(note) - row.check:SetChecked(checked) + for i,row in ipairs(rows) do + row.i = i + offset + local action, name, note, logi, complete, hasitem, turnedin, fullquestname = self:GetObjectiveInfo(i + offset) + if not name then row:Hide() + else + row:Show() + + local shortname = name:gsub("%s%(Part %d+%)", "") + logi = not turnedin and (accepted[name] or not accepted[shortname]) and logi + complete = not turnedin and (accepted[name] or not accepted[shortname]) and complete + local checked = turnedin or action == "ACCEPT" and logi or action == "COMPLETE" and complete + + if action == "ACCEPT" and logi then + accepted[name] = true + accepted[shortname] = true + end + + row.icon:SetTexture(self.icons[action]) + row.text:SetText(name) + row.detail:SetText(note) + row.check:SetChecked(checked) + end end end diff --git a/OHGuides.lua b/OHGuides.lua dissimilarity index 65% index df65fa8..5211782 100644 --- a/OHGuides.lua +++ b/OHGuides.lua @@ -1,76 +1,103 @@ - - -local TourGuide = TourGuide -local OptionHouse = DongleStub("OptionHouse-1.0") -local ww = WidgetWarlock -WidgetWarlock = nil - - -local ROWHEIGHT = 26 -local ROWOFFSET = 4 -local NUMROWS = math.floor(305/(ROWHEIGHT+4)) - - -local offset = 0 - - - -local function OnShow() ---~ offset = TourGuide.current - NUMROWS/2 - 1 ---~ if offset < 0 then offset = 0 ---~ elseif (offset + NUMROWS) > #TourGuide.actions then offset = #TourGuide.actions - NUMROWS end - TourGuide:UpdateGuidesPanel() -end - - -function TourGuide:CreateGuidesPanel() - local frame = ww.SummonOptionHouseBaseFrame() - local w = frame:GetWidth() - - frame.rows = {} - for i=1,NUMROWS do - local row = CreateFrame("Button", nil, frame) - row:SetPoint("TOPLEFT", i == 1 and frame or frame.rows[i-1], i == 1 and "TOPLEFT" or "BOTTOMLEFT", 0, -ROWOFFSET) - row:SetWidth(w/2) - row:SetHeight(ROWHEIGHT) - - local check = ww.SummonCheckBox(ROWHEIGHT, row, "TOPLEFT", ROWOFFSET, 0) - local text = ww.SummonFontString(row, nil, nil, "GameFontNormal", nil, "LEFT", check, "RIGHT", ROWOFFSET, 0) - ---~ check:SetScript("OnClick", function(f) self:SetTurnedIn(row.i, f:GetChecked()) end) - - row.text = text ---~ row.detail = detail - row.check = check ---~ row.icon = icon - frame.rows[i] = row - end - ---~ frame:EnableMouseWheel() ---~ frame:SetScript("OnMouseWheel", function(f, val) ---~ offset = offset - val ---~ if offset < 0 then offset = 0 ---~ elseif (offset + NUMROWS) > #self.actions then offset = #self.actions - NUMROWS end ---~ self:UpdateOHPanel() ---~ end) - - self.OHGuidesFrame = frame - frame:SetScript("OnShow", OnShow) - OnShow() ---~ self:UpdateGuidesPanel() - return frame -end - - -function TourGuide:UpdateGuidesPanel() - if not self.OHGuidesFrame or not self.OHGuidesFrame:IsVisible() then return end - for i,row in ipairs(self.OHGuidesFrame.rows) do ---~ row.i = i + offset - - local name = self.guidelist[i] - - row.text:SetText(name) - row.check:SetChecked(self.db.char.currentguide == name) - end -end - + + +local TourGuide = TourGuide +local OptionHouse = DongleStub("OptionHouse-1.0") +local ww = WidgetWarlock +WidgetWarlock = nil + + +local ROWHEIGHT = 22 +local NUMROWS = math.floor(305/(ROWHEIGHT)) + + +local offset, elapsed = 0, 0 +local rows = {} +local frame, fader + + +local function OnShow() + TourGuide:UpdateGuidesPanel() + + frame:SetAlpha(0) + elapsed = 0 + fader:Show() +end + + +local function OnClick(self) + local text = self.text:GetText() + if not text then self:SetChecked(false) + else + TourGuide:LoadGuide(text) + TourGuide:UpdateGuidesPanel() + TourGuide:UpdateStatusFrame() + end +end + + +function TourGuide:CreateGuidesPanel() + fader = CreateFrame("Frame") + fader:Hide() + fader:SetScript("OnUpdate", function(self, elap) + elapsed = elapsed + elap + if elapsed > 1 then + self:Hide() + frame:SetAlpha(1) + else frame:SetAlpha(elapsed) end + end) + + frame = ww.SummonOptionHouseBaseFrame() + local w = frame:GetWidth() + + rows = {} + for i=1,NUMROWS*2 do + local anchor, point + if i == 1 then anchor, point = frame, "TOPLEFT" + elseif i <= NUMROWS then anchor, point = rows[i-1], "BOTTOMLEFT" + else anchor, point = rows[i-NUMROWS], "TOPRIGHT" end + + local row = CreateFrame("CheckButton", nil, frame) + row:SetPoint("TOPLEFT", anchor, point) + row:SetWidth(w/2) + row:SetHeight(ROWHEIGHT) + + local highlight = ww.SummonTexture(row, w/2, ROWHEIGHT, "Interface\\HelpFrame\\HelpFrameButton-Highlight") + highlight:SetTexCoord(0, 1, 0, 0.578125) + highlight:SetAllPoints() + row:SetHighlightTexture(highlight) + row:SetCheckedTexture(highlight) + + local text = ww.SummonFontString(row, nil, nil, "GameFontNormal", nil, "LEFT", 6, 0) + + row:SetScript("OnClick", OnClick) + + row.text = text + rows[i] = row + end + +--~ frame:EnableMouseWheel() +--~ frame:SetScript("OnMouseWheel", function(f, val) +--~ offset = offset - val*NUMROWS +--~ if (offset + NUMROWS*2) > #self.guidelist then offset = #self.guidelist - NUMROWS*2 end +--~ if offset < 0 then offset = 0 end +--~ self:UpdateGuidesPanel() +--~ end) + + frame:SetScript("OnShow", OnShow) + OnShow() + return frame +end + + +function TourGuide:UpdateGuidesPanel() + if not frame or not frame:IsVisible() then return end + for i,row in ipairs(rows) do + row.i = i + offset + + local name = self.guidelist[i] + + row.text:SetText(name) + row:SetChecked(self.db.char.currentguide == name) + end +end + diff --git a/StatusFrame.lua b/StatusFrame.lua index 982ac6f..5457135 100644 --- a/StatusFrame.lua +++ b/StatusFrame.lua @@ -105,10 +105,7 @@ function TourGuide:UpdateStatusFrame() QuestLog_Update() QuestWatch_Update() - if not nextstep and self.nextzones[self.db.char.currentguide] then - self:LoadGuide() - return self:UpdateStatusFrame() - end + if not nextstep and self:LoadNextGuide() then return self:UpdateStatusFrame() end if not nextstep then return end diff --git a/TourGuide.lua b/TourGuide.lua index 11f7e07..2f164ec 100644 --- a/TourGuide.lua +++ b/TourGuide.lua @@ -3,6 +3,7 @@ local OptionHouse = DongleStub("OptionHouse-1.0") local myfaction = UnitFactionGroup("player") +local showdebug = true TourGuide = DongleStub("Dongle-1.0"):New("TourGuide") @@ -25,6 +26,7 @@ TourGuide.icons = setmetatable({ GRIND = "Interface\\Icons\\INV_Stone_GrindingStone_05", ITEM = "Interface\\Icons\\INV_Misc_Bag_08", BUY = "Interface\\Icons\\INV_Misc_Coin_01", + BOAT = "Interface\\Icons\\Spell_Frost_SummonWaterElemental" }, {__index = function() return "Interface\\Icons\\INV_Misc_QuestionMark" end}) @@ -48,7 +50,6 @@ local actiontypes = { function TourGuide:Initialize() self.db = self:InitializeDB("TourGuideAlphaDB", { char = { - currentguide = self.guidelist[1], turnedin = {}, cachedturnins = {}, } @@ -56,6 +57,7 @@ function TourGuide:Initialize() self.turnedin = self.db.char.turnedin self.cachedturnins = self.db.char.cachedturnins + self.db.char.currentguide = self.db.char.currentguide or self.guidelist[1] self:LoadGuide(self.db.char.currentguide) end @@ -82,21 +84,30 @@ end function TourGuide:LoadGuide(name) - name = name or self.nextzones[self.db.char.currentguide] if not name then return end - -- Clean out old completed objectives, to avoid conflicts - if name ~= self.db.char.currentguide then - for i,quest in ipairs(self.quests) do self.turnedin[quest] = nil end - end + self.db.char.currentguide = name + if not self.guides[name] then self.db.char.currentguide = self.guidelist[1] end + self:ParseObjectives(self.guides[self.db.char.currentguide](), showdebug) +end + + +function TourGuide:LoadNextGuide() + local name = self.nextzones[self.db.char.currentguide] + if not name then return end + + for i,quest in ipairs(self.quests) do self.turnedin[quest] = nil end -- Clean out old completed objectives, to avoid conflicts self.db.char.currentguide = name self:ParseObjectives(self.guides[name](), showdebug) + self:UpdateGuidesPanel() + return true end function TourGuide:GetQuestLogIndexByName(name) - name = name or self.quests[self.current]:gsub("%s%(Part %d+%)", "") + name = name or self.quests[self.current] + name = name:gsub("%s%(Part %d+%)", "") for i=1,GetNumQuestLogEntries() do if GetQuestLogTitle(i) == name then return i end end @@ -104,7 +115,6 @@ end function TourGuide:GetQuestDetails(name) if not name then return end - name = name:gsub("%s%(Part %d+%)", "") local i = self:GetQuestLogIndexByName(name) local complete = i and select(7, GetQuestLogTitle(i)) == 1 @@ -141,8 +151,8 @@ end local isdebugging = false local myclass = UnitClass("player") local titlematches = {"For", "A", "The", "Or", "In", "Then", "From", "Our"} -local accepts, turnins, completes = {}, {}, {} local function ParseQuests(...) + local accepts, turnins, completes = {}, {}, {} local uniqueid = 1 local actions, notes, quests, items = {}, {}, {}, {} local i = 1 @@ -153,6 +163,7 @@ local function ParseQuests(...) if text ~= "" and (not class or class == myclass) then local _, _, action, quest = text:find("^(%a) ([^|]*)") + assert(actiontypes[action], "Unknown action: "..text) quest = quest:trim() if not (action == "I" or action == "A" or action =="C" or action =="T") then quest = quest.."@"..uniqueid.."@" diff --git a/TourGuide.toc b/TourGuide.toc index a0d6db3..821c9c4 100644 --- a/TourGuide.toc +++ b/TourGuide.toc @@ -23,6 +23,15 @@ QuestTracking.lua Horde\01_05_SunstriderIsle.lua Horde\05_13_Eversong.lua +Horde\26_27_Ashenvale.lua +Horde\27_StonetalonMountains.lua +Horde\27_29_ThousandNeedles.lua +##Horde\29_30_HillsbradFoothills.lua +##Horde\30_30_ArathiHighlands.lua +##Horde\30_31_StranglethornVale.lua +##Horde\31_32_ThousandNeedles.lua +##Horde\32_34_Desolace.lua +##Horde\34_36_StranglethornVale.lua Alliance\01_06_Shadowglen.lua Alliance\06_12_Teldrassil.lua -- 2.11.4.GIT