diff --git a/CHANGELOG.md b/CHANGELOG.md index ca5985f..1c58168 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## v1.3.7 — Quest Tracking & Robustness + +- **[Quest Tracking]** Resolved inconsistent quest tracking/untracking by making the tracking state idempotent. This eliminates "doing nothing" results while toggling quests in the Quest Log and prevents tracking loops caused by Blizzard's auto-track feature. +- **[Robustness]** Improved `QuestieTracker` to safely handle `nil` returns from the WoW API (`GetQuestLogTitle`), preventing potential "attempt to compare number with nil" errors during rapid quest log updates. +- **[Internal Logic]** Refined the detection of internal Blizzard objective updates to ensure they don't accidentally untrack quests that the user intended to watch. +- **[Linting]** Suppressed diagnostic warnings related to global namespace shimming in `QuestieCompat.lua`. + ## v1.3.6 — Tooltip Fixes & Enhanced Taint Workaround - **[Quest Progress]** Resolved an issue where quest tooltips would not reliably update their progress counts when dynamically learning AI spawns or during rapid kill credit updates. diff --git a/Compat/Compat.lua b/Compat/Compat.lua index a28da10..d15efe4 100644 --- a/Compat/Compat.lua +++ b/Compat/Compat.lua @@ -38,8 +38,7 @@ local QuestieNameplate = QuestieLoader:ImportModule("QuestieNameplate") local QuestieCorrections = QuestieLoader:ImportModule("QuestieCorrections") -- addon/folder name -local addonName, _ = ... -QuestieCompat.addonName = addonName or "Questie" +QuestieCompat.addonName = QuestieLoader.addonName or "Questie" -- polyfill hooksecurefunc for 1.12 if not hooksecurefunc then diff --git a/Modules/Libs/QuestieLib.lua b/Modules/Libs/QuestieLib.lua index ac7d9dc..de8fc99 100644 --- a/Modules/Libs/QuestieLib.lua +++ b/Modules/Libs/QuestieLib.lua @@ -11,7 +11,7 @@ local QuestiePlayer = QuestieLoader:ImportModule("QuestiePlayer") local l10n = QuestieLoader:ImportModule("l10n") --- COMPATIBILITY --- -local addonName = QuestieCompat.Is335 and QuestieCompat.addonName or "Questie" +local addonName = QuestieLoader.addonName QuestieLib.AddonPath = "Interface\\Addons\\"..addonName.."\\" diff --git a/Modules/Libs/QuestieLoader.lua b/Modules/Libs/QuestieLoader.lua index 958ffa1..a7ecb8b 100644 --- a/Modules/Libs/QuestieLoader.lua +++ b/Modules/Libs/QuestieLoader.lua @@ -61,6 +61,8 @@ end ---@class QuestieLoader QuestieLoader = QuestieLoader or {} +local addonName = ... +QuestieLoader.addonName = addonName or "Questie" local modules = (QuestieLoader._modules) or {} @@ -101,7 +103,13 @@ function QuestieLoader:PopulateGlobals() -- called when debugging is enabled if _G[name] == nil then _G[name] = module elseif _G[name] ~= module then - Questie:Debug(Questie.DEBUG_CRITICAL, "[QuestieLoader] GLOBAL COLLISION: '" .. tostring(name) .. "' already exists in _G! Skipping population to avoid Taint.") + -- Use a safe print fallback if Questie is not yet initialized or does not have Debug + local msg = "[QuestieLoader] WARNING: Global collision detected for '" .. tostring(name) .. "'. Skipping population to avoid taining the global namespace." + if Questie and Questie.Debug then + Questie:Debug(1, msg) + else + print("|cFFFF0000" .. msg .. "|r") + end end end end diff --git a/Modules/QuestieCompat.lua b/Modules/QuestieCompat.lua index fea2b0a..e938703 100644 --- a/Modules/QuestieCompat.lua +++ b/Modules/QuestieCompat.lua @@ -1,6 +1,8 @@ ---@diagnostic disable: undefined-global, return-type-mismatch, undefined-field ---@class QuestieCompat +---@type table|_G QuestieCompat = setmetatable({}, { __index = _G }) +QuestieCompat.addonName = QuestieLoader.addonName ------------------------------------------ -- Lua 5.0 / 5.1 / 5.2 compatibility shims diff --git a/Modules/Tracker/QuestieTracker.lua b/Modules/Tracker/QuestieTracker.lua index b9ae1f1..8b41fac 100644 --- a/Modules/Tracker/QuestieTracker.lua +++ b/Modules/Tracker/QuestieTracker.lua @@ -2288,11 +2288,13 @@ function QuestieTracker.RemoveQuestWatch(index, isQuestie) if not isQuestie then if index then local questId = select(8, GetQuestLogTitle(index)) - if questId == 0 then + if (not questId) or questId == 0 then -- When an objective progresses in TBC "index" is the questId, but when a quest is manually removed from -- the quest watch (e.g. shift clicking it in the quest log) "index" is the questLogIndex. -- We should NOT untrack when Blizzard calls this with a questId internally during objective updates. - Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieTracker.RemoveQuestWatch] - Internal Blizzard update, skipping untrack for ID:", index) + if questId == 0 then + Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieTracker.RemoveQuestWatch] - Internal Blizzard update, skipping untrack for ID:", index) + end return end @@ -2351,22 +2353,19 @@ function QuestieTracker:AQW_Insert(index, expire) RemoveQuestWatch(index, true) local questId = select(8, GetQuestLogTitle(index)) - if questId == 0 then + if (not questId) or questId == 0 then -- When an objective progresses in TBC "index" is the questId, but when a quest is manually added to the quest watch -- (e.g. shift clicking it in the quest log) "index" is the questLogIndex. questId = index end - if questId > 0 then + if questId and questId > 0 then -- These checks makes sure the only way to track a quest is through the Blizzard Quest Log -- or another Addon hooked into the Blizzard Quest Log that replaces the default Quest Log. if not Questie.db.profile.autoTrackQuests then - if Questie.db.char.TrackedQuests[questId] then - Questie.db.char.TrackedQuests[questId] = nil - else - -- Add quest to the tracker - Questie.db.char.TrackedQuests[questId] = true - end + -- Manual track mode: force track when AddQuestWatch is called + Questie.db.char.TrackedQuests[questId] = true + Questie.db.char.AutoUntrackedQuests[questId] = nil else if Questie.db.char.AutoUntrackedQuests[questId] then -- Quest was manually hidden — shift-click re-tracks it diff --git a/Modules/WorldMapTaintWorkaround.lua b/Modules/WorldMapTaintWorkaround.lua index 1d98c19..537b53c 100644 --- a/Modules/WorldMapTaintWorkaround.lua +++ b/Modules/WorldMapTaintWorkaround.lua @@ -2,23 +2,28 @@ -- This should be independednt of Questie and all libraries. local function doWorkaround() - -- Blizzard's bugs - -- https://github.com/Stanzilla/WoWUIBugs/issues/114 and https://github.com/Stanzilla/WoWUIBugs/issues/165 - -- HDB (and Questie fork of it) uses WorldMapFrame:AddDataProvider(). - -- Reassigning the _Update functions (e.g. WorldMapContinentDropDown_Update = function() end) - -- BEFORE any calls are made is often more reliable than only Hiding the frame. + -- On 3.3.5, the WorldMap has several dropdowns that are prone to tainting UIDropDownMenu. + -- We hide them and replace their global update functions with no-ops. + -- This prevents Blizzard code from calling tainted logic when opening the map. - if WorldMapZoneMinimapDropDown then - WorldMapZoneMinimapDropDown:Hide() - WorldMapZoneMinimapDropDown.Update = function() end - end - if WorldMapContinentDropDown then - WorldMapContinentDropDown:Hide() - WorldMapContinentDropDown.Update = function() end - end - if WorldMapZoneDropDown then - WorldMapZoneDropDown:Hide() - WorldMapZoneDropDown.Update = function() end + local dropdowns = { + "WorldMapContinentDropDown", + "WorldMapZoneDropDown", + "WorldMapZoneMinimapDropDown", + "WorldMapMagnifyingGlassButton" + } + + for _, name in ipairs(dropdowns) do + local frame = _G[name] + if frame then + if frame.Hide then frame:Hide() end + -- Replacing the global update function is the standard workaround. + -- Do NOT assign to frame.Update as that taints the frame object itself. + local updateFuncName = name .. "_Update" + if _G[updateFuncName] then + _G[updateFuncName] = function() end + end + end end end diff --git a/Questie-X-Classic.toc b/Questie-X-Classic.toc index cf683a7..ebcec21 100644 --- a/Questie-X-Classic.toc +++ b/Questie-X-Classic.toc @@ -1,11 +1,11 @@ ## Interface: 30300 -## Title: |cFF5EBAF3Questie|r|cFFDAFAFD-X|r-Classic|cFF00FF00 v1.3.3|r +## Title: |cFF5EBAF3Questie|r|cFFDAFAFD-X|r-Classic|cFF00FF00 v1.3.7|r ## Notes: A standalone Classic QuestHelper ## Notes-esMX: Ayundante de misión ## Notes-esES: Ayundante de misión ## Notes-ptBR: Ajudante de missão ## Notes-frFR: Assistant de quête -## Version: 1.3.6 +## Version: 1.3.7 ## RequiredDeps: ## OptionalDeps: Ace3, CallbackHandler-1.0, HereBeDragons, LibDataBroker-1.1, LibDBIcon-1.0, LibSharedMedia-3.0, LibStub, LibUIDropDownMenu ## SavedVariables: QuestieConfig diff --git a/Questie-X-TBC.toc b/Questie-X-TBC.toc index 6e6f37c..169ff60 100644 --- a/Questie-X-TBC.toc +++ b/Questie-X-TBC.toc @@ -1,11 +1,11 @@ ## Interface: 30300 -## Title: |cFF5EBAF3Questie|r|cFFDAFAFD-X|r-TBC|cFF00FF00 v1.3.3|r +## Title: |cFF5EBAF3Questie|r|cFFDAFAFD-X|r-TBC|cFF00FF00 v1.3.7|r ## Notes: A standalone Classic QuestHelper ## Notes-esMX: Ayundante de misión ## Notes-esES: Ayundante de misión ## Notes-ptBR: Ajudante de missão ## Notes-frFR: Assistant de quête -## Version: 1.3.6 +## Version: 1.3.7 ## RequiredDeps: ## OptionalDeps: Ace3, CallbackHandler-1.0, HereBeDragons, LibDataBroker-1.1, LibDBIcon-1.0, LibSharedMedia-3.0, LibStub, LibUIDropDownMenu ## SavedVariables: QuestieConfig diff --git a/Questie-X-Turtle.toc b/Questie-X-Turtle.toc index 480dbad..07acda9 100644 --- a/Questie-X-Turtle.toc +++ b/Questie-X-Turtle.toc @@ -1,11 +1,11 @@ ## Interface: 11200 -## Title: |cFF5EBAF3Questie|r|cFFDAFAFD-X|r-Turtle|cFF00FF00 v1.3.3|r +## Title: |cFF5EBAF3Questie|r|cFFDAFAFD-X|r-Turtle|cFF00FF00 v1.3.7|r ## Notes: A standalone Classic QuestHelper -## Notes-esMX: Ayundante de misión -## Notes-esES: Ayundante de misión -## Notes-ptBR: Ajudante de missão -## Notes-frFR: Assistant de quête -## Version: 1.3.6 +## Notes-esMX: Ayundante de misiones +## Notes-esES: Ayundante de misiones +## Notes-ptBR: Ajudante de misiones +## Notes-frFR: Assistant de quêtes +## Version: 1.3.7 ## RequiredDeps: ## OptionalDeps: Ace3, CallbackHandler-1.0, HereBeDragons, LibDataBroker-1.1, LibDBIcon-1.0, LibSharedMedia-3.0, LibStub, LibUIDropDownMenu, Questie-X-TurtleDB ## SavedVariables: QuestieConfig diff --git a/Questie-X.toc b/Questie-X.toc index 4fe2780..34ce5cd 100644 --- a/Questie-X.toc +++ b/Questie-X.toc @@ -11,7 +11,7 @@ ## Notes-esES: Ayundante de misión ## Notes-ptBR: Ajudante de missão ## Notes-frFR: Assistant de quête -## Version: 1.3.6 +## Version: 1.3.7 ## RequiredDeps: ## OptionalDeps: Ace3, CallbackHandler-1.0, HereBeDragons, LibDataBroker-1.1, LibDBIcon-1.0, LibSharedMedia-3.0, LibStub, LibUIDropDownMenu, Questie-X-WotLKDB, Questie-X-ClassicDB, Questie-X-TBCDB, Questie-X-TurtleDB, Questie-X-AscensionDB, Questie-X-EbonholdDB ## SavedVariables: QuestieConfig, QuestieLearnerDB diff --git a/docs/changelog.html b/docs/changelog.html index e805626..0a31eb6 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -176,6 +176,16 @@
QuestieTracker to safely handle nil returns from the WoW API (GetQuestLogTitle), preventing potential "attempt to compare number with nil" errors during rapid quest log updates.QuestieCompat.lua.