From 01899cc6ca6b4e9c8ff4bf095b5bb2973045cbdd Mon Sep 17 00:00:00 2001 From: Rivi-s Date: Fri, 11 Sep 2026 21:01:56 -0700 Subject: [PATCH] Release 8.0.24 tracker and map fixes --- CHANGELOG.md | 6 ++++ config.lua | 6 ++++ map.lua | 34 +++++++++++------- pfQuest-tbc.toc | 2 +- pfQuest-wotlk.toc | 2 +- pfQuest.toc | 2 +- quest.lua | 9 +++++ tracker.lua | 90 +++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 136 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fac9607..e71066d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # pfQuest base patch notes +## 8.0.24 — 2026-09-11 + +- Added level-first and nearest-objective sorting controls to the quest tracker. +- Made Ctrl-hide for minimap nodes react immediately in every refresh mode. +- Fixed stale world-map filter labels and zone state after browsing another map. + ## 8.0.23 — 2026-09-11 - Added `/db version`, which reports the loaded pfQuest base version and Turtle extension version when installed. diff --git a/config.lua b/config.lua index 4a43a11..81cb8c8 100644 --- a/config.lua +++ b/config.lua @@ -120,6 +120,12 @@ pfQuest_defconfig = { default = 1, type = nil, }, + { + config = "trackerquestsort", + text = nil, + default = "level", + type = nil, + }, { text = L["General"], default = nil, type = "header" }, { text = L["Enable World Map Menu"], default = "1", type = "checkbox", config = "worldmapmenu" }, diff --git a/map.lua b/map.lua index 11cfc4a..f6f3fdd 100644 --- a/map.lua +++ b/map.lua @@ -1478,6 +1478,22 @@ function pfMap:UpdateMinimap() return end + -- Holding Ctrl over the minimap is an interaction gesture, not a normal map + -- refresh. Handle it before the selected refresh mode can defer work for + -- several hundred milliseconds, then force one redraw on release. + local hideMinimapNodes = controlkey.pressed and MouseIsOver(pfMap.drawlayer) + if hideMinimapNodes then + this.xPlayer = nil + this.minimapHiddenByCtrl = true + for _, pin in pairs(pfMap.mpins) do + pin:Hide() + end + return + elseif this.minimapHiddenByCtrl then + this.minimapHiddenByCtrl = nil + this.minimapTick = nil + end + -- Smooth preserves the original high-end behavior. The other modes reduce -- repeated pin placement in dense areas, especially at wide minimap zoom. local mZoom = pfMap.drawlayer:GetZoom() @@ -1495,17 +1511,6 @@ function pfMap:UpdateMinimap() end this.minimapTick = GetTime() + interval - -- hide all minimap nodes while shift is pressed - if controlkey.pressed and MouseIsOver(pfMap.drawlayer) then - this.xPlayer = nil - - for id, pin in pairs(pfMap.mpins) do - pin:Hide() - end - - return - end - -- The 1.12 API reports the player in the coordinates of whichever World Map -- view is currently selected. While a continent map is open that is not the -- player's zone, so use the last real-zone position for minimap placement. @@ -1902,7 +1907,12 @@ pfMap:SetScript("OnUpdate", function() resetmap = true elseif resetmap == true then SetMapToCurrentZone() - pfMap.playerMapID = pfMap:GetPlayerMapID() or pfMap:GetMapID(GetCurrentMapContinent(), GetCurrentMapZone()) + -- Do not call GetPlayerMapID here: it intentionally returns the cached + -- value first, which would preserve the map the player was browsing. + -- Read the client map context we just restored instead. + pfMap.playerMapID = pfMap:GetMapID(GetCurrentMapContinent(), GetCurrentMapZone()) + or (GetRealZoneText and pfMap:GetMapIDByName(GetRealZoneText())) + pfMap:MarkMapVisited(pfMap.playerMapID) resetmap = nil end diff --git a/pfQuest-tbc.toc b/pfQuest-tbc.toc index 6edd1b5..fe80c72 100644 --- a/pfQuest-tbc.toc +++ b/pfQuest-tbc.toc @@ -3,7 +3,7 @@ ## Author: Shagu ## Notes: A Questhelper and Database ## Notes-ruRU: Облегченный помощник заданий и база данных -## Version: 8.0.21 +## Version: 8.0.24 ## OptionalDeps: pfUI-tbc ## SavedVariables: pfQuest_questcache ## SavedVariablesPerCharacter: pfQuest_config, pfBrowser_fav, pfQuest_history, pfQuest_colors, pfQuest_server, pfQuest_track diff --git a/pfQuest-wotlk.toc b/pfQuest-wotlk.toc index 3593e62..0ec58ae 100644 --- a/pfQuest-wotlk.toc +++ b/pfQuest-wotlk.toc @@ -3,7 +3,7 @@ ## Author: Shagu ## Notes: A Questhelper and Database ## Notes-ruRU: Облегченный помощник заданий и база данных -## Version: 8.0.21 +## Version: 8.0.24 ## OptionalDeps: pfUI-wotlk ## SavedVariables: pfQuest_questcache ## SavedVariablesPerCharacter: pfQuest_config, pfBrowser_fav, pfQuest_history, pfQuest_colors, pfQuest_server, pfQuest_track diff --git a/pfQuest.toc b/pfQuest.toc index 4b7cb9a..ae26406 100644 --- a/pfQuest.toc +++ b/pfQuest.toc @@ -3,7 +3,7 @@ ## Author: Shagu, txtsd ## Notes: A Questhelper and Database ## Notes-ruRU: Облегченный помощник заданий и база данных -## Version: 8.0.23 +## Version: 8.0.24 ## OptionalDeps: pfUI ## SavedVariables: pfQuest_questcache, pfQuest_global ## SavedVariablesPerCharacter: pfQuest_config, pfBrowser_fav, pfQuest_history, pfQuest_colors, pfQuest_server, pfQuest_track diff --git a/quest.lua b/quest.lua index 823cfdf..37f3756 100644 --- a/quest.lua +++ b/quest.lua @@ -757,6 +757,15 @@ function pfQuest:AddWorldMapIntegration() pfQuest.mapButton:SetPoint("TOPRIGHT", 0, -10) pfQuest.mapButton:SetScript("OnShow", function() pfQuest.mapButton.current = tonumber(pfQuest_config["trackingmethod"]) + -- Version 8.0.23 briefly exposed a sixth filter while it was being + -- evaluated. It was removed before release, but that value can remain + -- in a test character's saved settings. A dropdown with no matching + -- entry keeps whatever text it last drew (often a zone name), so repair + -- the setting before building the menu. + if not pfQuest.mapButton.current or pfQuest.mapButton.current < 1 or pfQuest.mapButton.current > 5 then + pfQuest.mapButton.current = 1 + pfQuest_config["trackingmethod"] = "1" + end pfQuest.mapButton:UpdateMenu() end) diff --git a/tracker.lua b/tracker.lua index 78cb46b..0d1dd81 100644 --- a/tracker.lua +++ b/tracker.lua @@ -85,6 +85,56 @@ end local expand_states = {} +-- Ported from pfQuest-2: level-first remains the default, with an optional +-- nearest-objective order selected from the tracker header. +local function GetQuestSortMode() + return pfQuest_config["trackerquestsort"] == "distance" and "distance" or "level" +end + +local DIST_FAR = 99999999 + +local function UpdateSortButton() + if not tracker or not tracker.btnsort then return end + if tracker.mode == "QUEST_TRACKING" then + tracker.btnsort:Show() + if GetQuestSortMode() == "distance" then + tracker.btnsort.label:SetText("N") + tracker.btnsort.tooltip = "Quest Sort: Nearest First\n|cff33ffcc|r Sort By Level" + else + tracker.btnsort.label:SetText("L") + tracker.btnsort.tooltip = "Quest Sort: Level First\n|cff33ffcc|r Sort By Nearest" + end + else + tracker.btnsort:Hide() + end +end + +local function UpdateQuestDistances() + if tracker.mode ~= "QUEST_TRACKING" or GetQuestSortMode() ~= "distance" then return end + + local changed, nearestByTitle = nil, {} + for _, data in ipairs((pfQuest.route and pfQuest.route.coords) or {}) do + local node, distance = data[3], data[4] + local title = node and node.title + if title and distance and (not nearestByTitle[title] or distance < nearestByTitle[title]) then + nearestByTitle[title] = distance + end + end + + for _, button in pairs(tracker.buttons) do + if not button.empty then + local distance = nearestByTitle[button.title] + if button.distance ~= distance then + button.distance = distance + changed = true + end + elseif button.distance then + button.distance = nil + end + end + if changed then tracker.needsSort = true end +end + tracker = CreateFrame("Frame", "pfQuestMapTracker", UIParent) tracker:Hide() tracker:SetPoint("LEFT", UIParent, "LEFT", 0, 0) @@ -152,6 +202,15 @@ tracker:SetScript("OnUpdate", function() if pfQuestCompat.QuestWatchFrame:IsShown() then pfQuestCompat.QuestWatchFrame:Hide() end + + if tracker.mode == "QUEST_TRACKING" and GetQuestSortMode() == "distance" then + if not this.distanceTick or this.distanceTick < GetTime() then + this.distanceTick = GetTime() + 0.2 + UpdateQuestDistances() + end + else + this.distanceTick = nil + end end) -- Section collapse/expand emits QUEST_LOG_UPDATE. Refresh on that event @@ -169,6 +228,7 @@ tracker:SetScript("OnEvent", function() else this:Show() end + UpdateSortButton() elseif event == "QUEST_LOG_UPDATE" then this.sectionSignature = nil this:ScheduleLayout() @@ -249,19 +309,44 @@ do -- button panel tracker.btnquest = CreateButton("quests", "TOPLEFT", pfQuest_Loc["Show Current Quests"], function() tracker.mode = "QUEST_TRACKING" + UpdateSortButton() pfMap:UpdateNodes() end) tracker.btndatabase = CreateButton("database", "TOPLEFT", pfQuest_Loc["Show Database Results"], function() tracker.mode = "DATABASE_TRACKING" + UpdateSortButton() pfMap:UpdateNodes() end) tracker.btngiver = CreateButton("giver", "TOPLEFT", pfQuest_Loc["Show Quest Givers"], function() tracker.mode = "GIVER_TRACKING" + UpdateSortButton() pfMap:UpdateNodes() end) + tracker.btnsort = CreateFrame("Button", nil, tracker.panel) + tracker.btnsort:SetPoint("TOPRIGHT", -69, -1) + tracker.btnsort:SetWidth(panelheight - 2) + tracker.btnsort:SetHeight(panelheight - 2) + tracker.btnsort.tooltip = "Quest Sort" + tracker.btnsort.bg = tracker.btnsort:CreateTexture(nil, "BACKGROUND") + tracker.btnsort.bg:SetAllPoints() + tracker.btnsort.bg:SetTexture(0, 0, 0, 0) + tracker.btnsort.label = tracker.btnsort:CreateFontString(nil, "OVERLAY", "GameFontNormal") + tracker.btnsort.label:SetAllPoints() + tracker.btnsort.label:SetFont(pfUI.font_default, 11) + tracker.btnsort.label:SetTextColor(0.9, 0.9, 0.9, 1) + tracker.btnsort:SetScript("OnEnter", ShowTooltip) + tracker.btnsort:SetScript("OnLeave", HideTooltip) + tracker.btnsort:SetScript("OnClick", function() + pfQuest_config["trackerquestsort"] = GetQuestSortMode() == "distance" and "level" or "distance" + UpdateSortButton() + tracker.needsSort = true + tracker.distanceTick = 0 + pfMap.queue_update = GetTime() + end) + tracker.btnclose = CreateButton("close", "TOPRIGHT", pfQuest_Loc["Close Tracker"], function() DEFAULT_CHAT_FRAME:AddMessage( pfQuest_Loc["|cff33ffccpf|cffffffffQuest: Tracker is now hidden. Type `/db tracker` to show."] @@ -377,8 +462,13 @@ local function trackersort(a, b) return false elseif (a.tracked and 1 or -1) ~= (b.tracked and 1 or -1) then return (a.tracked and 1 or -1) > (b.tracked and 1 or -1) + elseif tracker.mode == "QUEST_TRACKING" and GetQuestSortMode() == "distance" + and (a.distance or DIST_FAR) ~= (b.distance or DIST_FAR) then + return (a.distance or DIST_FAR) < (b.distance or DIST_FAR) elseif (a.level or -1) ~= (b.level or -1) then return (a.level or -1) > (b.level or -1) + elseif tracker.mode == "QUEST_TRACKING" and (a.distance or DIST_FAR) ~= (b.distance or DIST_FAR) then + return (a.distance or DIST_FAR) < (b.distance or DIST_FAR) elseif (a.perc or -1) ~= (b.perc or -1) then return (a.perc or -1) > (b.perc or -1) elseif (a.title or "") ~= (b.title or "") then