Verified Commit 29cf5d05 authored by Repooc's avatar Repooc
Browse files

clean up to reflect elvui changes as well as add support for showing added...

clean up to reflect elvui changes as well as add support for showing added Custom Currencies using the option "Display in Main Tooltip" option
parent 543b9faa
...@@ -151,7 +151,7 @@ local function OnEvent(self) ...@@ -151,7 +151,7 @@ local function OnEvent(self)
local displayed = E.global.datatexts.settings.Currencies.displayedCurrency local displayed = E.global.datatexts.settings.Currencies.displayedCurrency
if displayed == 'BACKPACK' then if displayed == 'BACKPACK' then
local displayString = '' local displayString
for i = 1, 3 do for i = 1, 3 do
local info = C_CurrencyInfo_GetBackpackCurrencyInfo(i) local info = C_CurrencyInfo_GetBackpackCurrencyInfo(i)
if info and info.quantity then if info and info.quantity then
...@@ -159,7 +159,7 @@ local function OnEvent(self) ...@@ -159,7 +159,7 @@ local function OnEvent(self)
end end
end end
self.text:SetText(displayString == '' and goldText or displayString) self.text:SetText(displayString or goldText)
elseif displayed == 'GOLD' then elseif displayed == 'GOLD' then
self.text:SetText(goldText) self.text:SetText(goldText)
else else
...@@ -250,14 +250,12 @@ local function OnEnter() ...@@ -250,14 +250,12 @@ local function OnEnter()
DT.tooltip:AddLine(' ') DT.tooltip:AddLine(' ')
wipe(shownHeaders) wipe(shownHeaders)
local addLine local addLine, addLine2
for _, info in ipairs(E.global.datatexts.settings.Currencies.tooltipData) do for _, info in ipairs(E.global.datatexts.settings.Currencies.tooltipData) do
local _, id, header = unpack(info) local _, id, header = unpack(info)
if id and E.global.datatexts.settings.Currencies.idEnable[id] then if id and E.global.datatexts.settings.Currencies.idEnable[id] then
AddHeader(header, addLine) AddHeader(header, addLine)
if type(id) == 'number' then AddInfo(id)
AddInfo(id)
end
addLine = true addLine = true
end end
end end
...@@ -266,6 +264,17 @@ local function OnEnter() ...@@ -266,6 +264,17 @@ local function OnEnter()
DT.tooltip:AddLine(' ') DT.tooltip:AddLine(' ')
end end
for _, info in pairs(E.global.datatexts.customCurrencies) do
if info and not DT.CurrencyList[tostring(info.ID)] and info.DISPLAY_IN_MAIN_TOOLTIP then
AddInfo(info.ID)
addLine2 = true
end
end
if addLine2 then
DT.tooltip:AddLine(' ')
end
DT.tooltip:AddDoubleLine(L["WoW Token:"], E:FormatMoney(C_WowTokenPublic_GetCurrentMarketPrice() or 0, style, textOnly), 0, .8, 1, 1, 1, 1) DT.tooltip:AddDoubleLine(L["WoW Token:"], E:FormatMoney(C_WowTokenPublic_GetCurrentMarketPrice() or 0, style, textOnly), 0, .8, 1, 1, 1, 1)
-- ElvUI Gold DT -> Watched Backpack Currencies -- ElvUI Gold DT -> Watched Backpack Currencies
......
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