|
|
|
|
@ -236,12 +236,16 @@ function private.OnItemBought(_, data)
|
|
|
|
|
TSM:DecodeItemData(itemID) |
|
|
|
|
local link = data.link or select(2, TSMAPI:GetSafeItemInfo(data.itemString)) or data.itemString |
|
|
|
|
local buyoutText = data.buyout and (TSMAPI:FormatTextMoney(data.buyout, "|cffffffff", true) or "---") or "---" |
|
|
|
|
local total = TSM.data[itemID].quantity |
|
|
|
|
local minBuyout = TSM:GetMinBuyout(itemID) |
|
|
|
|
local total = 0 |
|
|
|
|
local baseItemString = TSMAPI:GetBaseItemString(data.itemString) |
|
|
|
|
for _, _, itemString, quantity in TSMAPI:GetBagIterator() do |
|
|
|
|
if TSMAPI:GetBaseItemString(itemString) == baseItemString then |
|
|
|
|
total = total + quantity |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
local marketValue = TSM:GetMarketValue(itemID) |
|
|
|
|
local minText = minBuyout and (TSMAPI:FormatTextMoney(minBuyout, "|cffffffff", true) or "---") or "---" |
|
|
|
|
local marketText = marketValue and (TSMAPI:FormatTextMoney(marketValue, "|cffffffff", true) or "---") or "---" |
|
|
|
|
TSM:Printf("Bought %s for %s (x%d). items=%s dbmin=%s dbmarket=%s", link, buyoutText, data.count or 1, total and tostring(total) or "?", minText, marketText) |
|
|
|
|
TSM:Printf("Bought %s for %s (x%d). bags=%s dbmarket=%s", link, buyoutText, data.count or 1, tostring(total), marketText) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
function TSM:OnTSMDBShutdown() |
|
|
|
|
|