extracted sorting into a separate file. may later replace the unstable sort in the TSM table by a stable sort
This commit is contained in:
+3
-3
@@ -50,7 +50,7 @@ function public.on_load()
|
||||
{
|
||||
title = 'Auction Item',
|
||||
width = 280,
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end,
|
||||
comparator = function(row1, row2) return Aux.sort.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.sort.GT) end,
|
||||
cell_initializer = function(cell)
|
||||
local icon = CreateFrame('Button', nil, cell)
|
||||
icon:EnableMouse(false)
|
||||
@@ -91,7 +91,7 @@ function public.on_load()
|
||||
{
|
||||
title = 'Qty',
|
||||
width = 25,
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.stack_size, row2.stack_size, Aux.util.LT) end,
|
||||
comparator = function(row1, row2) return Aux.sort.compare(row1.stack_size, row2.stack_size, Aux.sort.LT) end,
|
||||
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
|
||||
cell_setter = function(cell, datum)
|
||||
cell.text:SetText(datum.aux_quantity)
|
||||
@@ -101,7 +101,7 @@ function public.on_load()
|
||||
{
|
||||
title = 'Current Bid',
|
||||
width = 80,
|
||||
comparator = function(auction1, auction2) return Aux.util.compare(auction1.high_bid, auction2.high_bid, Aux.util.GT) end,
|
||||
comparator = function(auction1, auction2) return Aux.sort.compare(auction1.high_bid, auction2.high_bid, Aux.sort.GT) end,
|
||||
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
|
||||
cell_setter = function(cell, auction)
|
||||
cell.text:SetText(auction.high_bid and Aux.util.money_string(auction.high_bid) or RED_FONT_COLOR_CODE..'No Bids'..FONT_COLOR_CODE_CLOSE)
|
||||
|
||||
Reference in New Issue
Block a user