feat(tooltip): ElvUI style without ElvUI; source in secondary only; fix learner source label

- ElvUI tooltip style: new 'ElvUI tooltip style' option (General tab, on by
  default) skins GameTooltip/WorldMapTooltip/ItemRefTooltip/shopping tooltips
  and the secondary learner frame with ElvUI's transparent flat look (dark bg
  + thin 1px border) when ElvUI is not installed. Corrected the secondary
  frame fallback that used the chunky WoW border. No-op when ElvUI is loaded.

- Source attribution now shows ONLY inside the secondary learner tooltip when
  'Use secondary learner tooltip' is enabled; removed from the main NPC/object/
  item tooltip and gated off entirely when the secondary tooltip is disabled
  (map-pin source gated the same way).

- Fixed learner-learned pins mislabelled 'AscensionDB': GetPinDataSource is now
  mode-aware and returns 'Learner' in learner mode when the entity has a learner
  record, even if AscensionDB also curates it (curated coords are discarded by
  GetNPC/GetObject in learner mode anyway).

Test-neutral (145 successes / same 7 pre-existing failures + 1 error).
This commit is contained in:
Xurkon
2026-06-09 21:52:55 -05:00
parent ee67653414
commit fa37ab8eb5
8 changed files with 121 additions and 40 deletions
+20 -9
View File
@@ -4615,17 +4615,19 @@ local function _ApplyElvUIStyleTooltip(frame)
return
end
end
-- ElvUI default "Transparent" template — see ElvUI/Core/Toolkit.lua:82
-- and ElvUI/Settings/Profile.lua:29-31. Hard-coded so the secondary
-- frame looks the same with or without ElvUI.
-- ElvUI "Transparent" template — see ElvUI/Core/Toolkit.lua SetTemplate and
-- ElvUI/Settings/Profile.lua:29-31. ElvUI uses a FLAT texture for both the
-- background and the border with a 1px (E.mult) edge, NOT the chunky default
-- WoW tooltip border — so use a solid texture and edgeSize 1 to match.
if not frame.SetBackdrop then return end
local FLAT = "Interface\\ChatFrame\\ChatFrameBackground" -- solid 1x1 texture on 3.3.5
frame:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true,
tileSize = 16,
edgeSize = 12,
insets = {left = 3, right = 3, top = 3, bottom = 3},
bgFile = FLAT,
edgeFile = FLAT,
tile = false,
tileSize = 0,
edgeSize = 1,
insets = {left = 0, right = 0, top = 0, bottom = 0},
})
-- (0.06, 0.06, 0.06, 0.8) — ElvUI's default backdropfadecolor
frame:SetBackdropColor(0.06, 0.06, 0.06, 0.8)
@@ -4779,6 +4781,15 @@ local function _AddLearnedSpawnTooltipLine(unitToken)
for _, pair in ipairs(lines) do
rendered[#rendered + 1] = pair[1] .. ": " .. pair[2]
end
-- Data-source attribution belongs ONLY in this secondary frame, and only when the
-- source option is enabled. It is never added to the main tooltip; when the secondary
-- learner tooltip is disabled it does not appear at all.
local QuestieTooltips = QuestieLoader:ImportModule("QuestieTooltips")
local sourceLine = QuestieTooltips and QuestieTooltips.GetDataSourceLine
and QuestieTooltips:GetDataSourceLine("m_" .. npcId)
if sourceLine then
rendered[#rendered + 1] = sourceLine
end
-- Spacer after learner section
rendered[#rendered + 1] = " "
_ShowLearnerTooltipFrame(GameTooltip, rendered)