module refactoring

This commit is contained in:
Simon Hirsig
2017-11-01 15:01:41 +01:00
parent 9989ceb42f
commit 8823b34904
36 changed files with 669 additions and 646 deletions
+8 -7
View File
@@ -1,22 +1,23 @@
module 'aux.tabs.bids'
include 'T'
include 'aux'
local T = require 'T'
local info = require 'aux.util.info'
local scan_util = require 'aux.util.scan'
local scan = require 'aux.core.scan'
TAB 'Bids'
local tab = TAB 'Bids'
auction_records = {}
function OPEN()
function tab.OPEN()
frame:Show()
scan_bids()
end
function CLOSE()
function tab.CLOSE()
frame:Hide()
end
@@ -29,11 +30,11 @@ function M.scan_bids()
status_bar:update_status(0, 0)
status_bar:set_text('Scanning auctions...')
wipe(auction_records)
T.wipe(auction_records)
update_listing()
scan.start{
type = 'bidder',
queries = A(O('blizzard_query', T)),
queries = T.list(T.map('blizzard_query', T.acquire())),
on_page_loaded = function(page, total_pages)
status_bar:update_status(page / total_pages, 0)
status_bar:set_text(format('Scanning (Page %d / %d)', page, total_pages))
@@ -120,7 +121,7 @@ do
elseif state == FOUND and not scan_util.test(selection.record, found_index) then
buyout_button:Disable()
bid_button:Disable()
if not bid_in_progress then state = IDLE end
if not bid_in_progress() then state = IDLE end
end
end
end