fix(tooltip): never add learner spawn data to the main tooltip

The 'Use secondary learner tooltip' option's off-path appended learner
spawn/kill lines directly to the main GameTooltip. The toggle now gates
the data entirely: on = shown in the separate secondary frame, off = not
shown anywhere. Learner spawn/kill data is never inline in the main NPC
tooltip under any setting.

Removed the now-unused _AddTooltipSeparator helper and updated the option
description.
This commit is contained in:
Xurkon
2026-06-09 18:20:39 -05:00
parent 0c4631be6e
commit 08b266d7ba
3 changed files with 5 additions and 24 deletions
+1
View File
@@ -28,6 +28,7 @@
### Bug Fixes
- **[Tooltip - Learner Spawn Data Never In Main Tooltip]** Learner spawn/kill data is no longer added inline to the main NPC tooltip under any setting. Previously, with the "Use secondary learner tooltip" option off, `_AddLearnedSpawnTooltipLine` appended the lines directly to `GameTooltip`. The toggle now gates the data entirely: on = shown in the separate secondary frame, off = not shown anywhere. Removed the now-unused `_AddTooltipSeparator` helper and updated the option description. (Complements the earlier System A suppression that kept the duplicate learner lines out of the main tooltip.)
- **[Tooltip - Stale Quest Objective Lookup On Turn-In]** Hovering an NPC right after turning in (or abandoning) one of its associated quests spammed a `debugstack` trace in DEVELOP mode: the learner objective-correlation block in `QuestieTooltips:GetTooltip` called `QuestLogCache.GetQuestObjectives` for a quest no longer in `QuestLogCache` (gracefully returns `{}`, but logs a stack). The NPC and object correlation loops now skip quests not in `QuestiePlayer.currentQuestlog`, so live objective progress is only looked up for quests the player is currently on. No functional change for active quests (a completed quest had no progress to show anyway).
- **[Tooltip - Secondary Learner Tooltip Leak]** With the "Use secondary learner tooltip" option enabled, learner spawn/kill lines still appeared in the main NPC tooltip instead of going solely to the secondary frame. Two parallel learner-tooltip systems were both rendering on unit hover: QuestieLearner's `OnTooltipSetUnit` hook (toggle-aware, secondary-capable) and `Tooltip.lua`'s `_GetLearnerTooltipLines` (always injected "Learned spawn / Total spawns learned / Total kills recorded" into the `m_<npcId>` tooltip data). `QuestieTooltips:GetTooltip` now takes a `suppressLearnerLines` flag, and the NPC unit-hover call in `TooltipHandler.lua` passes it so the inline learner lines are omitted there — the `OnTooltipSetUnit` hook owns that display and routes it to the main tooltip (secondary off) or the separate secondary frame (secondary on). Map-pin and object tooltips are unaffected and keep their learner lines. Also removes the latent duplicate learner lines that appeared in the main tooltip even with the secondary frame disabled.
- **[Map - Completed Objective Pins Linger]** Added `QuestieMap:UnloadQuestFramesForObjective(questId, objectiveIndex)` and call it from every completion path in `QuestieQuest:PopulateObjective` (objective completed, hidden by `ShouldHideObjective`, and static no-`Update` objectives). Previously, removing a completed objective's map/minimap pins relied solely on `_UnloadAlreadySpawnedIcons`, which walks `objective.AlreadySpawned`. That table desyncs from the frames actually on screen after learner spawn-list invalidation or complete→abandon→reaccept cycles, so when it was reset to `{}` the live frames leaked and pins for fully-completed objectives (e.g. 6/6 kills, a collected item objective) stayed on the map even though tooltips updated correctly. The new function unloads frames deterministically off the map's own `questIdFrames` registry by matching `frame.data.ObjectiveIndex`, so completed-objective pins are removed regardless of `AlreadySpawned` state. Restricted to positive standard-objective indices; SpecialObjectives (sentinel index 0) keep using `AlreadySpawned` to avoid cross-unloading siblings.
@@ -550,7 +550,7 @@ function QuestieOptions.tabs.general:Initialize()
type = "toggle",
order = 8.6,
name = function() return l10n('Use secondary learner tooltip'); end,
desc = function() return l10n('Show learner-specific spawn details in a separate tooltip instead of adding them to the existing one.'); end,
desc = function() return l10n('Show learner-specific spawn details in a separate tooltip attached to the unit tooltip. When disabled, learner spawn details are not shown (they are never added to the main tooltip).'); end,
width = 1.5,
disabled = function() return not (Questie.db.profile.enableTooltips and (Questie.db.profile.learnerTooltips ~= false)); end,
get = function() return Questie.db.profile.learnerTooltipUseSecondary == true end,
+3 -23
View File
@@ -4684,16 +4684,6 @@ local function _HideLearnerTooltipFrame()
end
end
-- Adds a blank double-line spacer to a tooltip. Used as a lightweight
-- visual separator between learner data and surrounding tooltip content
-- when the secondary frame is disabled.
local function _AddTooltipSeparator(tooltip)
-- AddDoubleLine(leftText, rightText, leftR, leftG, leftB, rightR, rightG, rightB)
-- Passing " " for both with 0 alpha makes the line invisible, creating a
-- clean one-line vertical gap without needing any texture assets.
tooltip:AddDoubleLine(" ", " ", 0, 0, 0, 0, 0, 0)
end
local function _ShowLearnerTooltipFrame(sourceTooltip, lines)
local tooltip = _GetLearnerTooltipFrame()
tooltip:ClearLines()
@@ -4793,19 +4783,9 @@ local function _AddLearnedSpawnTooltipLine(unitToken)
rendered[#rendered + 1] = " "
_ShowLearnerTooltipFrame(GameTooltip, rendered)
else
-- Thin horizontal separator above learner section so it doesn't
-- visually blend into the NPC data above.
_AddTooltipSeparator(GameTooltip)
for _, pair in ipairs(lines) do
GameTooltip:AddDoubleLine(pair[1], pair[2])
end
-- Thin horizontal separator below learner section to separate
-- from any addon data appended below (e.g. other tooltip mods).
_AddTooltipSeparator(GameTooltip)
local QuestieTooltips = QuestieLoader:ImportModule("QuestieTooltips")
if QuestieTooltips and QuestieTooltips.ResizeTooltip then
QuestieTooltips:ResizeTooltip(GameTooltip)
end
-- Learner spawn/kill data is never added to the main tooltip. When the secondary
-- learner tooltip is disabled, it is not shown anywhere (the toggle gates it).
_HideLearnerTooltipFrame()
end
end