Commit 32cb9a53 authored by Azilroka's avatar Azilroka
Browse files

DT: Currency Tooltip to support Max Currency

parent b845f42b
......@@ -21,16 +21,18 @@ end
local function GetInfo(id)
local info = C_CurrencyInfo_GetCurrencyInfo(id)
if info then
return info.name, info.quantity, (info.iconFileID and format(iconString, info.iconFileID)) or '136012'
else
return '', '', '136012'
return info.name, info.quantity, info.maxQuantity, (info.iconFileID and format(iconString, info.iconFileID)) or '136012'
end
end
local function AddInfo(id)
local name, num, icon = GetInfo(id)
local name, num, max, icon = GetInfo(id)
if name then
DT.tooltip:AddDoubleLine(format('%s %s', icon, name), BreakUpLargeNumbers(num), 1, 1, 1, 1, 1, 1)
local textRight = '%s'
if E.global.datatexts.settings.Currencies.maxCurrency and max and max > 0 then
textRight = '%s / '..BreakUpLargeNumbers(max)
end
DT.tooltip:AddDoubleLine(format('%s %s', icon, name), format(textRight, BreakUpLargeNumbers(num)), 1, 1, 1, 1, 1, 1)
end
end
......
......@@ -47,7 +47,7 @@ G.datatexts = {
CallToArms = { Label = '', NoLabel = false },
Combat = { TimeFull = true },
Crit = { Label = '', NoLabel = false, decimalLength = 1 },
Currencies = { goldFormat = 'BLIZZARD', goldCoins = true, displayedCurrency = 'BACKPACK', displayStyle = 'ICON', tooltipData = {}, idEnable = {}, headers = true },
Currencies = { goldFormat = 'BLIZZARD', goldCoins = true, displayedCurrency = 'BACKPACK', displayStyle = 'ICON', tooltipData = {}, idEnable = {}, headers = true, maxCurrency = false },
Durability = { percThreshold = 30 },
ElvUI = { Label = '' },
Experience = { textFormat = 'CUR' },
......
......@@ -204,6 +204,7 @@ local function CreateDTOptions(name, data)
optionTable.args.displayStyle = ACH:Select(L["Display Style"], nil, 1, { ICON = L["Icons Only"], ICON_TEXT = L["Icons and Text"], ICON_TEXT_ABBR = L["Icons and Text (Short)"] }, nil, nil, nil, nil, nil, function() return (settings.displayedCurrency == "GOLD") or (settings.displayedCurrency == "BACKPACK") end)
optionTable.args.headers = ACH:Toggle(L["Headers"])
optionTable.args.maxCurrency = ACH:Toggle(L["Show Max Currency"])
optionTable.args.goldFormat.hidden = function() return (settings.displayedCurrency ~= "GOLD") end
optionTable.args.goldCoins.hidden = function() return (settings.displayedCurrency ~= "GOLD") end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment