Commit 44ae1fce authored by Azilroka's avatar Azilroka
Browse files

Grey Value in Tooltip

parent 6196cb77
......@@ -150,6 +150,10 @@ function B:Tooltip_Show()
end
end
if self.ttValue then
GameTooltip:AddLine(E:FormatMoney(self.ttValue(), E.db.bags.moneyFormat, not E.db.bags.moneyCoins), 1, 1, 1)
end
GameTooltip:Show()
end
......@@ -1198,27 +1202,6 @@ function B:UpdateGoldText()
B.BagFrame.goldText:SetText(E:FormatMoney(GetMoney(), E.db.bags.moneyFormat, not E.db.bags.moneyCoins))
end
function B:FormatMoney(amount)
local str, coppername, silvername, goldname = '', '|cffeda55fc|r', '|cffc7c7cfs|r', '|cffffd700g|r'
local value = abs(amount)
local gold = floor(value / 10000)
local silver = floor((value / 100) % 100)
local copper = floor(value % 100)
if gold > 0 then
str = format('%d%s%s', gold, goldname, (silver > 0 or copper > 0) and ' ' or '')
end
if silver > 0 then
str = format('%s%d%s%s', str, silver, silvername, copper > 0 and ' ' or '')
end
if copper > 0 or value == 0 then
str = format('%s%d%s', str, copper, coppername)
end
return str
end
function B:GetGraysValue()
local value = 0
......@@ -1702,6 +1685,7 @@ function B:ConstructContainerFrame(name, isBank)
f.vendorGraysButton:GetPushedTexture():SetInside()
f.vendorGraysButton:StyleButton(nil, true)
f.vendorGraysButton.ttText = L["Vendor / Delete Grays"]
f.vendorGraysButton.ttValue = B.GetGraysValue
f.vendorGraysButton:SetScript('OnEnter', B.Tooltip_Show)
f.vendorGraysButton:SetScript('OnLeave', GameTooltip_Hide)
f.vendorGraysButton:SetScript('OnClick', B.VendorGrayCheck)
......@@ -2215,7 +2199,7 @@ function B:ProgressQuickVendor()
local stackCount = select(2, GetContainerItemInfo(bag, slot)) or 1
local stackPrice = (itemPrice or 0) * stackCount
if E.db.bags.vendorGrays.details and link then
E:Print(format('%s|cFF00DDDDx%d|r %s', link, stackCount, B:FormatMoney(stackPrice)))
E:Print(format('%s|cFF00DDDDx%d|r %s', link, stackCount, E:FormatMoney(stackPrice, E.db.bags.moneyFormat, not E.db.bags.moneyCoins)))
end
UseContainerItem(bag, slot)
......@@ -2239,7 +2223,7 @@ function B:VendorGreys_OnUpdate(elapsed)
elseif lastItem then
B.SellFrame:Hide()
if B.SellFrame.Info.goldGained > 0 then
E:Print((L["Vendored gray items for: %s"]):format(B:FormatMoney(B.SellFrame.Info.goldGained)))
E:Print((L["Vendored gray items for: %s"]):format(E:FormatMoney(B.SellFrame.Info.goldGained, E.db.bags.moneyFormat, not E.db.bags.moneyCoins)))
end
end
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