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:
@@ -573,6 +573,12 @@ function QuestieMap:DrawManualIcon(data, areaID, x, y, typ)
|
||||
|
||||
data.Id = data.id
|
||||
|
||||
-- Manual notes are placed by the Townsfolk / menu system. Tag them so the source
|
||||
-- tooltip line can report it (only if a caller hasn't already set a more specific source).
|
||||
if data.DataSource == nil then
|
||||
data.DataSource = "Townsfolk"
|
||||
end
|
||||
|
||||
local uiMapId = _ResolveMapUiMapId(ZoneDB:GetUiMapIdByAreaId(areaID), x, y)
|
||||
if (not uiMapId) then
|
||||
Questie:Debug(Questie.DEBUG_CRITICAL, "[QuestieMap:DrawManualIcon] No UiMapID for areaId:", areaID, tostring(data.Name))
|
||||
@@ -714,6 +720,13 @@ function QuestieMap:DrawWorldIcon(data, areaID, x, y, showFlag)
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
-- Tag data-source provenance for the source tooltip line. Objective pins set this
|
||||
-- explicitly (per-spawn). Available/finisher pins are quest-scoped, so derive from the
|
||||
-- quest. Leave nil for anything else so the tooltip shows no (potentially wrong) source.
|
||||
if data.DataSource == nil and (data.Type == "available" or data.Type == "complete") then
|
||||
data.DataSource = QuestieDB.GetPinDataSource("QUEST", data.Id)
|
||||
end
|
||||
|
||||
local uiMapId = _ResolveMapUiMapId(ZoneDB:GetUiMapIdByAreaId(areaID), x, y)
|
||||
if (not uiMapId) then
|
||||
local parentMapId
|
||||
|
||||
Reference in New Issue
Block a user