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.

28 lines
743 B

5 years ago
local WIT, core = ...
local GridColumns = core.GridColumns
function GridColumns.CostColumn(options)
options = options or {}
options.Name = options.Name or 'Cost'
local self = GridColumns.ResultsValueColumn(options)
5 years ago
self.Description = core.GetString('CostDescription')
function self.GetItemPrice(item)
local id = item.Id == core.TSMHelper.PetCageItemId and 'p:'.. item.PetId or item.Id
5 years ago
if item.BuyFromVendor then
return core.TSMHelper.GetItemVendorBuyPrice(id) * (item.ApplyReputationDiscount and 0.8 or 1)
5 years ago
else
return core.TSMHelper.GetItemPrice(id)
5 years ago
end
end
function self.GetItemList(data)
return data.Materials
end
return self
end