Add tooltips to column headers in LDB display
Rubio9 opened this issue ยท 0 comments
It can be hard to remember what all the currency icons are.
I've added tooltips to them so you can hover over them to see what currency they represent.
In function Currencyflow:drawTooltip() --
[...]
-- Add a header for each of the currencies we're showing
local colNum = colsPerItem + 2
local icon
for id,currency in pairs(tracking) do
if self.db.profile["showCurrency"..id] then
tooltip:SetCell( lineNum, colNum, "|T"..currency.icon..":16|t", "CENTER" )
tooltip:SetCellScript( lineNum, colNum, "OnEnter", function()
if not CurrencyHeaderTooltip then CurrencyHeaderTooltip = CreateFrame("GameTooltip", "CurrencyHeaderTooltip", UIParent, "GameTooltipTemplate") end
CurrencyHeaderTooltip:SetOwner(tooltip, "ANCHOR_CURSOR")
CurrencyHeaderTooltip:SetText(currency.name)
CurrencyHeaderTooltip:SetFrameLevel(999)
CurrencyHeaderTooltip:Show()
end )
tooltip:SetCellScript( lineNum, colNum, "OnLeave", function()
CurrencyHeaderTooltip:Hide()
end )
colNum = colNum + 1
end
end