another massive refactoring, only post panel missing

This commit is contained in:
Manuel Simon Hirsig
2016-01-26 17:45:39 +01:00
parent 6474b1716f
commit 0d448e12c7
13 changed files with 433 additions and 480 deletions
+9 -5
View File
@@ -1,7 +1,7 @@
local m = {}
Aux.scan_util = m
function m.find_auction(type, test, search_query, page, status_bar, callback)
function m.find(type, test, search_query, page, status_bar, on_failure, on_success)
Aux.scan.abort(function()
@@ -16,17 +16,21 @@ function m.find_auction(type, test, search_query, page, status_bar, callback)
on_read_auction = function(auction_info, ctrl)
if test(auction_info.index) then
ctrl.suspend()
status_bar:update_status(100, 100)
status_bar:set_text('Auction found')
Aux.scan.abort(function()
callback(auction_info.index)
if not test(auction_info.index) then
return on_failure()
else
status_bar:update_status(100, 100)
status_bar:set_text('Auction found')
return on_success(auction_info.index)
end
end)
end
end,
on_complete = function()
status_bar:update_status(100, 100)
status_bar:set_text('Auction not found')
callback()
on_failure()
end,
next_page = function()
if getn(pages) == 1 then