diff --git a/aux-addon.lua b/aux-addon.lua index 5d21af2..aed0eed 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -218,14 +218,20 @@ function AUCTION_HOUSE_SHOW() set_tab(1) end -function AUCTION_HOUSE_CLOSED() - bids_loaded = false - current_owner_page = nil - post.stop() - stack.stop() - scan.abort() - set_tab() - AuxFrame:Hide() +do + local handlers = {} + function set_handler.CLOSE(f) + tinsert(handlers, f) + end + function AUCTION_HOUSE_CLOSED() + bids_loaded = false + current_owner_page = nil + for _, handler in handlers do + handler() + end + set_tab() + AuxFrame:Hide() + end end function AUCTION_BIDDER_LIST_UPDATE() diff --git a/core/post.lua b/core/post.lua index dcecd24..6a16b37 100644 --- a/core/post.lua +++ b/core/post.lua @@ -7,6 +7,10 @@ local stack = require 'aux.core.stack' local state +function handle.CLOSE() + stop() +end + function process() if state.posted < state.count then diff --git a/core/scan.lua b/core/scan.lua index f0d7242..4018bab 100644 --- a/core/scan.lua +++ b/core/scan.lua @@ -9,6 +9,10 @@ local history = require 'aux.core.history' local PAGE_SIZE = 50 +function handle.CLOSE() + abort() +end + do local scan_states = {} diff --git a/core/stack.lua b/core/stack.lua index e96279f..d0899b0 100644 --- a/core/stack.lua +++ b/core/stack.lua @@ -8,6 +8,10 @@ local info = require 'aux.util.info' local state +function handle.CLOSE() + stop() +end + function stack_size(slot) local container_item_info = T.temp-info.container_item(unpack(slot)) return container_item_info and container_item_info.count or 0