big refactoring
This commit is contained in:
+14
-14
@@ -1,5 +1,5 @@
|
||||
aux.module 'post_tab'
|
||||
aux.tab(2, 'Post', 'post_tab')
|
||||
aux.tab(2, 'Post')
|
||||
|
||||
local DURATION_4, DURATION_8, DURATION_24 = 120, 480, 1440
|
||||
local settings_schema = {'record', '#', {stack_size='number'}, {duration='number'}, {start_price='number'}, {buyout_price='number'}, {hidden='boolean'}}
|
||||
@@ -123,31 +123,31 @@ function private.update_auction_listing()
|
||||
|
||||
local bid_color
|
||||
if blizzard_bid_undercut < unit_start_price and stack_blizzard_bid_undercut < unit_start_price then
|
||||
bid_color = aux.auction_listing.colors.RED
|
||||
bid_color = aux.gui.inline_color.red
|
||||
elseif blizzard_bid_undercut < unit_start_price then
|
||||
bid_color = aux.auction_listing.colors.ORANGE
|
||||
bid_color = aux.gui.inline_color.orange
|
||||
elseif stack_blizzard_bid_undercut < unit_start_price then
|
||||
bid_color = aux.auction_listing.colors.YELLOW
|
||||
bid_color = aux.gui.inline_color.yellow
|
||||
end
|
||||
|
||||
local buyout_color
|
||||
if buyout_price_undercut < unit_buyout_price and stack_buyout_price_undercut < unit_buyout_price then
|
||||
buyout_color = aux.auction_listing.colors.RED
|
||||
buyout_color = aux.gui.inline_color.red
|
||||
elseif buyout_price_undercut < unit_buyout_price then
|
||||
buyout_color = aux.auction_listing.colors.ORANGE
|
||||
buyout_color = aux.gui.inline_color.orange
|
||||
elseif stack_buyout_price_undercut < unit_buyout_price then
|
||||
buyout_color = aux.auction_listing.colors.YELLOW
|
||||
buyout_color = aux.gui.inline_color.yellow
|
||||
end
|
||||
|
||||
tinsert(auction_rows, {
|
||||
cols = {
|
||||
{ value=auction_record.own and aux.auction_listing.colors.GREEN..auction_record.count..FONT_COLOR_CODE_CLOSE or auction_record.count },
|
||||
{ value=aux.auction_listing.time_left(auction_record.duration) },
|
||||
{ value=auction_record.stack_size == stack_size and aux.auction_listing.colors.GREEN..auction_record.stack_size..FONT_COLOR_CODE_CLOSE or auction_record.stack_size },
|
||||
{ value=aux.money.to_string(auction_record.unit_blizzard_bid, true, nil, 3, bid_color) },
|
||||
{ value=historical_value and aux.auction_listing.percentage_historical(aux.util.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 aux.auction_listing.percentage_historical(aux.util.round(auction_record.unit_buyout_price / historical_value * 100)) or '---' },
|
||||
{value=auction_record.own and aux.gui.color.yellow(auction_record.count) or auction_record.count},
|
||||
{value=aux.auction_listing.time_left(auction_record.duration)},
|
||||
{value=auction_record.stack_size == stack_size and aux.gui.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=historical_value and aux.auction_listing.percentage_historical(aux.util.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 aux.auction_listing.percentage_historical(aux.util.round(auction_record.unit_buyout_price / historical_value * 100)) or '---'},
|
||||
},
|
||||
record = auction_record,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user