You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
714 B

local WIT, core = ...
local GridColumns = core.GridColumns
function GridColumns.PriceSourceValueColumn(options)
options = options or {}
options.Name = options.Name or 'Value'
local self = GridColumns.GridColumn(options)
function self.Value(data)
local priceSource = data.PriceSource == "" and core.Config.GetPriceSourceString() or data.PriceSource
return core.TSMHelper.GetItemPrice(data.ItemId == core.TSMHelper.PetCageItemId and 'p:'.. data.PetId or data.ItemId, priceSource)
end
function self.GetRowText(row)
row[self.Name] = row[self.Name] or self.Value(row.Data)
return core.TSMHelper.ToMoneyString(row[self.Name])
end
return self
end