From b9cb058f7b4d4d8be5be9eb836d3a4663066a3a5 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Wed, 14 Oct 2015 00:59:26 +0200 Subject: [PATCH] some more progress, added back icons --- list.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/list.lua b/list.lua index bbeb86e..fc81789 100644 --- a/list.lua +++ b/list.lua @@ -239,10 +239,24 @@ function Aux.sheet.initialize(frame) title = 'Auction Item', texture = function(row) return row.texture end, comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end, - color = function(row) return ITEM_QUALITY_COLORS[row.quality] end, - cell_initializer = Aux.sheet.default_cell_initializer('LEFT'), + cell_initializer = function(cell) + local icon = CreateFrame('Button', nil, cell) + icon:SetPoint('LEFT', cell) + icon:SetWidth(12) + icon:SetHeight(12) + local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall') + text:SetPoint("LEFT", icon, "RIGHT", 1, 0) + text:SetPoint('TOPRIGHT', cell) + text:SetPoint('BOTTOMRIGHT', cell) + text:SetJustifyV('TOP') + text:SetJustifyH('LEFT') + text:SetTextColor(0.8, 0.8, 0.8) + cell.text = text + cell.icon = icon + end, cell_setter = function(cell, datum) - cell.text:SetText(' ['..datum.tooltip[1][1].text..']') + cell.icon:SetNormalTexture(datum.texture) + cell.text:SetText('['..datum.tooltip[1][1].text..']') local color = ITEM_QUALITY_COLORS[datum.quality] cell.text:SetTextColor(color.r, color.g, color.b) end,