refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-09-06 08:47:32 +02:00
parent def0dd3dda
commit 3e2814a752
4 changed files with 11 additions and 19 deletions
+1 -1
View File
@@ -674,7 +674,7 @@ local methods = {
self.isSorted = nil
self:SetSelectedRecord(nil, true)
sort(self.records, function(a, b) return sorting.multi_lt({a.search_signature, tostring(a)}, {b.search_signature, tostring(b)}) end)
sort(self.records, function(a, b) return sorting.multi_lt(temp-A(a.search_signature, tostring(a)), temp-A(b.search_signature, tostring(b))) end)
local records = self.records
if getn(records) == 0 then return end
+7 -7
View File
@@ -134,7 +134,7 @@ function update_auction_listing()
{value=auction_record.own and color.yellow(auction_record.count) or auction_record.count},
{value=al.time_left(auction_record.duration)},
{value=auction_record.stack_size == stack_size and color.yellow(auction_record.stack_size) or auction_record.stack_size},
{value=aux.money.to_string(auction_record.unit_blizzard_bid, true, nil, 3, bid_color) },
{value=aux.money.to_string(auction_record.unit_blizzard_bid, true, nil, 3, bid_color)},
{value=historical_value and al.percentage_historical(round(auction_record.unit_blizzard_bid / historical_value * 100)) or '---'},
{value=auction_record.unit_buyout_price > 0 and aux.money.to_string(auction_record.unit_buyout_price, true, nil, 3, buyout_color) or '---'},
{value=auction_record.unit_buyout_price > 0 and historical_value and al.percentage_historical(round(auction_record.unit_buyout_price / historical_value * 100)) or '---'},
@@ -144,20 +144,20 @@ function update_auction_listing()
end
sort(auction_rows, function(a, b)
return sorting.multi_lt(
{
temp-A(
a.record.unit_buyout_price == 0 and huge or a.record.unit_buyout_price,
a.record.unit_blizzard_bid,
a.record.stack_size,
b.record.own and 1 or 0,
a.record.duration,
},
{
a.record.duration
),
temp-A(
b.record.unit_buyout_price == 0 and huge or b.record.unit_buyout_price,
b.record.unit_blizzard_bid,
b.record.stack_size,
a.record.own and 1 or 0,
b.record.duration,
}
b.record.duration
)
)
end)
end
+1 -1
View File
@@ -42,7 +42,7 @@ function create_frames()
this.open = not this.open
end)
for _, offset in {14, 10, 6} do
for _, offset in temp-A(14, 10, 6) do
local fake_icon_part = btn:CreateFontString()
fake_icon_part:SetFont([[Fonts\FRIZQT__.TTF]], 23)
fake_icon_part:SetPoint('CENTER', 0, offset)
+2 -10
View File
@@ -4,19 +4,11 @@ _G.aux_auto_buy_filter = ''
do
local id = 0
search_scan_id
{
get = function() return id end,
set = function(v) id = v end,
}
search_scan_id { get=function() return id end, set=function(v) id = v end }
end
do
local validator
auto_buy_validator
{
get = function() return validator end,
set = function(v) validator = v end,
}
auto_buy_validator { get=function() return validator end, set=function(v) validator = v end }
end
do