another massive refactoring, only post panel missing
This commit is contained in:
+9
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user