tbc loop change part 3

This commit is contained in:
Manuel Simon Hirsig
2017-06-02 19:51:28 +02:00
parent d4b089d508
commit 4c5a7f2a75
9 changed files with 39 additions and 40 deletions
+5 -6
View File
@@ -122,8 +122,7 @@ function update_auction_listing(listing, records, reference)
if selected_item then
local historical_value = history.value(selected_item.key)
local stack_size = stack_size_slider:GetValue()
for i = 1, getn(records[selected_item.key] or empty) do
local record = records[selected_item.key][i]
for _, record in pairs(records[selected_item.key] or empty) do
local price_color = undercut(record, stack_size_slider:GetValue(), listing == 'bid') < reference and color.red
local price = record.unit_price * (listing == 'bid' and record.stack_size / stack_size_slider:GetValue() or 1)
tinsert(rows, O(
@@ -181,7 +180,7 @@ function update_auction_listings()
end
function M.select_item(item_key)
for _, inventory_record in filter(copy(inventory_records), function(record) return record.aux_quantity > 0 end) do
for _, inventory_record in pairs(filter(copy(inventory_records), function(record) return record.aux_quantity > 0 end)) do
if inventory_record.key == item_key then
update_item(inventory_record)
return
@@ -237,7 +236,7 @@ function post_auctions()
end
update_inventory_records()
local same
for _, record in inventory_records do
for _, record in pairs(inventory_records) do
if record.key == key then
same = record
break
@@ -500,7 +499,7 @@ function record_auction(key, aux_quantity, unit_blizzard_bid, unit_buyout_price,
bid_records[key] = bid_records[key] or T
do
local entry
for _, record in bid_records[key] do
for _, record in pairs(bid_records[key]) do
if unit_blizzard_bid == record.unit_price and aux_quantity == record.stack_size and duration == record.duration and cache.is_player(owner) == record.own then
entry = record
end
@@ -515,7 +514,7 @@ function record_auction(key, aux_quantity, unit_blizzard_bid, unit_buyout_price,
if unit_buyout_price == 0 then return end
do
local entry
for _, record in buyout_records[key] do
for _, record in pairs(buyout_records[key]) do
if unit_buyout_price == record.unit_price and aux_quantity == record.stack_size and duration == record.duration and cache.is_player(owner) == record.own then
entry = record
end