scan refactoring
This commit is contained in:
+2
-1
@@ -1,7 +1,7 @@
|
||||
## Interface: 11200
|
||||
## Title: Aux
|
||||
## Notes: A lightweight addon designed to help manage auctions
|
||||
## SavedVariablesPerCharacter: aux_recently_searched, aux_view, AUX_SELL_SHORTCUT, AUX_BUY_SHORTCUT, AUX_OPEN_SELL, AUX_OPEN_BUY, AUX_INSTANT_BUYOUT, AUX_AUCTION_DURATION
|
||||
## SavedVariablesPerCharacter: aux_recently_searched, aux_view, AUX_AUCTION_DURATION
|
||||
## SavedVariables: aux_database, aux_auctionable_items
|
||||
|
||||
slash.lua
|
||||
@@ -11,6 +11,7 @@ control.xml
|
||||
persistence.lua
|
||||
util.lua
|
||||
money.lua
|
||||
groups.lua
|
||||
|
||||
scan.lua
|
||||
scan_util.lua
|
||||
|
||||
@@ -11,35 +11,36 @@ local controller = (function()
|
||||
end
|
||||
end)()
|
||||
|
||||
local state, abort, new_job
|
||||
local state
|
||||
|
||||
local scan, scan_auctions, scan_auctions_helper, submit_query, wait_for_callback, wait_for_results, wait_for_owner_data, abort
|
||||
local scan, scan_auctions, scan_auctions_helper, submit_query, wait_for_callback, wait_for_results, wait_for_owner_data, on_abort
|
||||
|
||||
function Aux.scan.start(job)
|
||||
Aux.control.on_next_update(function()
|
||||
abort()
|
||||
return controller().wait(function() return true end, function()
|
||||
on_abort()
|
||||
job.type = job.type or 'list'
|
||||
state = {
|
||||
job = job,
|
||||
page = job.page
|
||||
job = job,
|
||||
page = job.page
|
||||
}
|
||||
|
||||
return scan()
|
||||
end)
|
||||
scan()
|
||||
end)
|
||||
end
|
||||
|
||||
function Aux.scan.abort(k)
|
||||
Aux.control.on_next_update(function()
|
||||
abort()
|
||||
|
||||
if k then
|
||||
return k()
|
||||
end
|
||||
end)
|
||||
controller().wait(function() return true end, function()
|
||||
on_abort()
|
||||
|
||||
state = nil
|
||||
|
||||
if k then
|
||||
return k()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function abort()
|
||||
controller().reset()
|
||||
function on_abort()
|
||||
if state and state.job and state.job.on_abort then
|
||||
state.job.on_abort()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user