From fb3c78351f33f71a794fda0f6de7090dc123be44 Mon Sep 17 00:00:00 2001 From: Xurkon Date: Fri, 12 Jun 2026 23:17:56 -0500 Subject: [PATCH] fix: show learner secondary tooltips without spawns --- CHANGELOG.md | 1 + Modules/QuestieLearner.lua | 52 ++++++++++++++++++++---------------- Modules/Tooltips/Tooltip.lua | 4 +-- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac740fd..ed068a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ ### Bug Fixes +- **[Learner - Secondary Tooltip Without Spawn Coordinates]** Unit-hover learner tooltips now still open the secondary learner tooltip when the learner has confidence data but no recorded spawn coordinates yet. The normal unit tooltip suppression path also suppresses the old inline learner confidence line, so secondary mode no longer leaks learner-only lines back into the main tooltip. - **[Map - Suppress Duplicate Native Quest POIs]** Rather than globally disabling the server/Blizzard objective POIs, Questie now keeps them enabled and hides only the individual Blizzard POI buttons for quests that already have a visible Questie POI (per-quest duplicate-POI suppression in `QuestieCompat`, hooked at init). Blizzard POIs still appear for quests Questie does not cover, but no longer stack on top of Questie's own objective icons. - **[Learner - Tooltips In Auto Mode]** Learner spawn tooltips now appear in Auto data-source mode, not only in learner-only mode, so learned spawn/quest detail still surfaces on hover while Auto is selected. - **[Prestige - Player Cache Reset]** The cached player level/race/class flags are now reset on prestige so available-quest eligibility recomputes against the new character state instead of stale pre-prestige values. diff --git a/Modules/QuestieLearner.lua b/Modules/QuestieLearner.lua index 225ce60..0c40793 100644 --- a/Modules/QuestieLearner.lua +++ b/Modules/QuestieLearner.lua @@ -4955,43 +4955,49 @@ local function _AddLearnedSpawnTooltipLine(unitToken) end local entry = Questie.dbLearner.global.npcs[npcId] - if not entry or not entry[7] then + if not entry then _HideLearnerTooltipFrame() return end - -- Find the first zone with spawn data - local spawnsByZone = entry[7] - local zoneId = next(spawnsByZone) - if not zoneId then + local hasSpawnData = entry[7] ~= nil + local hasConfidenceData = entry.mc ~= nil + if not hasSpawnData and not hasConfidenceData then _HideLearnerTooltipFrame() return end - local zoneSpawns = spawnsByZone[zoneId] - if not zoneSpawns or #zoneSpawns == 0 then - _HideLearnerTooltipFrame() - return - end - - -- Use the first recorded coordinate - local x = zoneSpawns[1][1] - local y = zoneSpawns[1][2] local kills = entry.mc or 0 - - local formattedX = ("%.1f"):format(x) - local formattedY = ("%.1f"):format(y) local lines = {} - if Questie.db.profile.learnerTooltipShowSpawn ~= false then - local text = ("(%s, %s)"):format(formattedX, formattedY) - if Questie.db.profile.learnerTooltipShowConfidence ~= false then - text = text .. (" from %d kill%s"):format(kills, kills == 1 and "" or "s") + + if hasSpawnData then + -- Find the first zone with spawn data + local spawnsByZone = entry[7] + local zoneId = next(spawnsByZone) + local zoneSpawns = zoneId and spawnsByZone[zoneId] + if zoneSpawns and #zoneSpawns > 0 and Questie.db.profile.learnerTooltipShowSpawn ~= false then + -- Use the first recorded coordinate + local x = zoneSpawns[1][1] + local y = zoneSpawns[1][2] + local formattedX = ("%.1f"):format(x) + local formattedY = ("%.1f"):format(y) + local text = ("(%s, %s)"):format(formattedX, formattedY) + if Questie.db.profile.learnerTooltipShowConfidence ~= false then + text = text .. (" from %d kill%s"):format(kills, kills == 1 and "" or "s") + end + lines[#lines + 1] = {"Learned spawn", text} end - lines[#lines + 1] = {"Learned spawn", text} end if Questie.db.profile.learnerTooltipShowTotalSpawns ~= false then - lines[#lines + 1] = {"Total spawns learned", tostring(_CountLearnedNpcSpawns(entry))} + local totalSpawns = _CountLearnedNpcSpawns(entry) + if totalSpawns > 0 then + lines[#lines + 1] = {"Total spawns learned", tostring(totalSpawns)} + end + end + + if #lines == 0 and hasConfidenceData and Questie.db.profile.learnerTooltipShowConfidence ~= false then + lines[#lines + 1] = {"Learner confidence", tostring(kills)} end if #lines == 0 then diff --git a/Modules/Tooltips/Tooltip.lua b/Modules/Tooltips/Tooltip.lua index 85a8843..c790d73 100644 --- a/Modules/Tooltips/Tooltip.lua +++ b/Modules/Tooltips/Tooltip.lua @@ -447,7 +447,7 @@ if key:sub(1,2) == "m_" then end end end - if learnedNpc.mc and _LearnerTooltipsEnabled() and Questie.db.profile.learnerTooltipShowConfidence ~= false then + if learnedNpc.mc and not suppressLearnerLines and _LearnerTooltipsEnabled() and Questie.db.profile.learnerTooltipShowConfidence ~= false then tinsert(tooltipLines, "|cFF5EBAF3(Learned - Confidence: " .. tostring(learnedNpc.mc) .. ")|r") end end @@ -504,7 +504,7 @@ elseif key:sub(1,2) == "o_" then end end end - if learnedObj.mc and _LearnerTooltipsEnabled() and Questie.db.profile.learnerTooltipShowConfidence ~= false then + if learnedObj.mc and not suppressLearnerLines and _LearnerTooltipsEnabled() and Questie.db.profile.learnerTooltipShowConfidence ~= false then tinsert(tooltipLines, "|cFF5EBAF3(Learned - Confidence: " .. tostring(learnedObj.mc) .. ")|r") end end