feat(tooltip): accurate per-pin data source attribution

Re-adds the 'Show data source' tooltip option (General tab, default off),
but accurate this time. The previous version was removed because it
guessed the source from the global data-source mode (showing Learner when
data was AscensionDB, etc.). This tags each pin with its real provenance
at creation and reads that tag.

- QuestieDB.GetPinDataSource(entityType, id, spawnData): resolves
  Learner (per-spawn isLearned or learner record), AscensionDB (curated
  ascensionOverrideKeys override), or base Questie DB. Never guesses.
- Objective pins tagged per-spawn in _DetermineIconsToDraw; available/
  finisher pins defaulted by quest in DrawWorldIcon; manual notes tagged
  Townsfolk in DrawManualIcon.
- World-map pins read the per-pin tag (MapIconTooltip); unit/object/item
  hovers derive per-id at the render layer (TooltipHandler via
  QuestieTooltips:GetDataSourceLine). Comms appended via KeyExists.
- No line shown when source is genuinely unknown (never misleading).
This commit is contained in:
Xurkon
2026-06-09 17:57:58 -05:00
parent d207feb3db
commit 0c4631be6e
9 changed files with 134 additions and 6 deletions
+19
View File
@@ -329,6 +329,12 @@ function _QuestieTooltips:AddUnitDataToTooltip()
end
end
-- Data-source attribution (opt-in; internally gated and nil when source unknown).
local npcSourceLine = QuestieTooltips:GetDataSourceLine("m_" .. npcId)
if npcSourceLine then
GameTooltip:AddLine(npcSourceLine)
end
local npcNum = tonumber(npcId)
if npcNum then
_AddQuestStarterDropsToTooltip(npcNum)
@@ -394,6 +400,11 @@ function _QuestieTooltips:AddItemDataToTooltip()
self:AddLine(v)
end
end
-- Data-source attribution (opt-in; internally gated and nil when source unknown).
local itemSourceLine = QuestieTooltips:GetDataSourceLine("i_" .. (itemId or 0))
if itemSourceLine then
self:AddLine(itemSourceLine)
end
QuestieTooltips.lastGametooltipCount = _QuestieTooltips:CountTooltip()
end
lastItemId = itemId;
@@ -448,6 +459,14 @@ function _QuestieTooltips:AddObjectDataToTooltip(name)
end
end
end
-- Data-source attribution for the hovered object (opt-in; nil when unknown).
local firstObjectId = lookup[1]
if firstObjectId then
local objSourceLine = QuestieTooltips:GetDataSourceLine("o_" .. firstObjectId)
if objSourceLine then
GameTooltip:AddLine(objSourceLine)
end
end
if QuestieTooltips.ResizeTooltip then
QuestieTooltips:ResizeTooltip(GameTooltip)
end