update done

This commit is contained in:
Manuel Simon Hirsig
2016-02-03 17:47:06 +01:00
parent 79b721371d
commit 6c5292e415
5 changed files with 6 additions and 71 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ function private.update_listing()
record = auction_record,
})
end
sort(auction_rows, function(a, b) return a.record.search_signature < b.record.search_signature end)
sort(auction_rows, function(a, b) return a.record.name < b.record.name or (b.record.name == b.record.name and a.record.search_signature < b.record.search_signature) end)
private.listing:SetData(auction_rows)
private.listing:SetSelection(function(row) return row.record == selected_auction end)
+1 -1
View File
@@ -89,7 +89,7 @@ function private.update_listing()
record = auction_record,
})
end
sort(auction_rows, function(a, b) return a.record.search_signature < b.record.search_signature end)
sort(auction_rows, function(a, b) return a.record.name < b.record.name or (b.record.name == b.record.name and a.record.search_signature < b.record.search_signature) end)
private.listing:SetData(auction_rows)
private.listing:SetSelection(function(row) return row.record == selected_auction end)
+1 -1
View File
@@ -128,7 +128,7 @@ function public.auction(index, type)
itemstring = item_info.itemstring,
item_key = item_id..':'..suffix_id,
signature = Aux.util.join({item_id, suffix_id, unique_id, enchant_id, aux_quantity, start_price, buyout_price}, ':'), -- not unique!
search_signature = Aux.util.join({item_id, suffix_id, enchant_id, buyout_price, bid_price, aux_quantity, duration, owner or ''}, ':'),
search_signature = Aux.util.join({item_id, suffix_id, enchant_id, start_price, buyout_price, bid_price, aux_quantity, duration, owner or ''}, ':'),
name = name,
texture = texture,
-65
View File
@@ -112,71 +112,6 @@ function public.create(params)
local total_width = 0
local labels = {}
for i = 1,getn(params.columns) do
local button = CreateFrame('Button', nil, content)
if i == 1 then
button:SetPoint('TOPLEFT', content, 'TOPLEFT', 5, params.plain and 16 or 0)
total_width = total_width + 5
else
button:SetPoint('TOPLEFT', content, 'TOPLEFT', total_width + 3, params.plain and 16 or 0)
total_width = total_width + 3
end
local label = content:CreateFontString(nil, 'OVERLAY', 'GameFontHighlight')
label:SetText(params.columns[i].title)
local column_width = params.columns[i].width or 30
total_width = total_width + column_width
button:SetWidth(column_width)
button:SetHeight(16)
button:SetID(i)
button:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
button:SetScript('OnMouseDown', function() Aux.sheet.sort(sheet, this:GetID()) end)
button:RegisterForClicks('LeftButtonDown', 'RightButtonDown')
local texture = content:CreateTexture(nil, 'ARTWORK')
texture:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
texture:SetTexCoord(0.1, 0.8, 0, 1)
texture:SetAllPoints(button)
button.texture = texture
local sort_texture = button:CreateTexture(nil, 'ARTWORK')
sort_texture:SetTexture([[Interface\Buttons\UI-SortArrow]])
sort_texture:SetPoint('TOPRIGHT', button, 'TOPRIGHT', 0, 0)
sort_texture:SetPoint('BOTTOM', button, 'BOTTOM', 0, 0)
sort_texture:SetWidth(12)
sort_texture:Hide()
button.sort_texture = sort_texture
-- local background = content:CreateTexture(nil, 'ARTWORK')
-- background:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
-- -- background:SetTextCoord(0.2, 0.9, 0, 0.9)
-- background:SetPoint('TOPLEFT', button, 'BOTTOMLEFT', 0, 0)
-- background:SetPoint('TOPRIGHT', button, 'BOTTOMRIGHT', 0, 0)
-- background:SetPoint('BOTTOM', content, 'BOTTOM', 0, 0)
-- background:SetAlpha(0.2)
label:SetPoint('TOPLEFT', button, 'TOPLEFT', 0, 0)
label:SetPoint('BOTTOMRIGHT', button, 'BOTTOMRIGHT', 0, 0)
label:SetJustifyH('CENTER')
label:SetJustifyV('CENTER')
label:SetTextColor(0.8, 0.8, 0.8)
label.button = button
label.texture = texture
label.sort_texture = sort_texture
label.background = background
labels[i] = label
if params.plain then
for _, obj in ipairs({button, label, texture, sort_texture, background}) do
obj:Hide()
end
end
end
total_width = total_width + 5
params.frame:SetWidth(total_width)
local rows = {}
local row_index = 1
local max_height = content:GetHeight()
+3 -3
View File
@@ -71,11 +71,11 @@ function public.compare(a, b, nil_ordering)
end
end
function public.compare_from_lt(comp)
function public.compare_from_lt(lt)
return function(a, b)
if comp(a, b) then
if lt(a, b) then
return public.LT
elseif comp(b, a) then
elseif lt(b, a) then
return public.GT
else
return public.EQ