more progress on the new filter tab, removed views

This commit is contained in:
Manuel Simon Hirsig
2016-01-29 23:23:47 +01:00
parent 473a66d3cc
commit 006b7a0582
12 changed files with 207 additions and 656 deletions
+25 -4
View File
@@ -1,15 +1,14 @@
local m = {}
Aux.listing_util = m
function m.money_column(name, getter)
function m.money_column(title, getter)
return {
title = name,
title = title,
width = 80,
comparator = function(datum1, datum2) return Aux.util.compare(getter(datum1), getter(datum2), Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, datum)
cell.text:SetText(getter(datum) and Aux.util.money_string(getter(datum)) or 'N/A')
-- group_alpha_setter(cell, getter(datum))
end,
}
end
@@ -31,7 +30,7 @@ function m.owner_column(getter)
end,
cell_initializer = Aux.sheet.default_cell_initializer('LEFT'),
cell_setter = function(cell, datum)
cell.text:SetText(getter(datum) == UnitName('player') and GREEN_FONT_COLOR_CODE..'You'..FONT_COLOR_CODE_CLOSE or getter(datum))
cell.text:SetText(getter(datum) == UnitName('player') and GREEN_FONT_COLOR_CODE..'You'..FONT_COLOR_CODE_CLOSE or getter(datum) or 'N/A')
end,
}
end
@@ -65,4 +64,26 @@ function m.percentage_market_column(item_key_getter, value_getter)
end
end,
}
end
function m.duration_column(getter)
return {
title = 'Left',
width = 30,
comparator = function(datum1, datum2) return Aux.util.compare(getter(datum1), getter(datum2), Aux.util.GT) end,
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
cell_setter = function(cell, datum)
local text
if getter(datum) == 1 then
text = '30m'
elseif getter(datum) == 2 then
text = '2h'
elseif getter(datum) == 3 then
text = '8h'
elseif getter(datum) == 4 then
text = '24h'
end
cell.text:SetText(text)
end,
}
end