diff --git a/Event_wardrum_ogre.ogg b/Event_wardrum_ogre.ogg new file mode 100644 index 0000000..bae6d94 Binary files /dev/null and b/Event_wardrum_ogre.ogg differ diff --git a/control.lua b/control.lua index 1f50964..08e7875 100644 --- a/control.lua +++ b/control.lua @@ -14,12 +14,25 @@ end function public.on_update() private.event_listeners = Aux.util.set_filter(private.event_listeners, function(l) return not l.deleted end) + local threads = {} + for thread_id, thread in pairs(private.threads) do + if not thread.killed then + threads[thread_id] = thread + end + end + private.threads = threads - for thread_id, k in pairs(private.threads) do - private.threads[thread_id] = nil - public.thread_id = thread_id - k() - public.thread_id = nil + for thread_id, thread in pairs(private.threads) do + if not thread.killed then + local k = thread.k + thread.k = nil + public.thread_id = thread_id + k() + public.thread_id = nil + if not thread.k then + thread.killed = true + end + end end end @@ -75,18 +88,18 @@ do function public.new_thread(k) local thread_id = next_thread_id next_thread_id = next_thread_id + 1 - private.threads[thread_id] = k + private.threads[thread_id] = { k = k } return thread_id end end function public.kill_thread(thread_id) - private.threads[thread_id] = nil + private.threads[thread_id].killed = true end function public.wait(...) local k = tremove(arg, 1) - private.threads[public.thread_id] = function() return k(unpack(arg)) end + private.threads[public.thread_id].k = function() return k(unpack(arg)) end end function public.wait_until(p, ...) diff --git a/scourge_horn.ogg b/scourge_horn.ogg new file mode 100644 index 0000000..80935ef Binary files /dev/null and b/scourge_horn.ogg differ diff --git a/search_frame.lua b/search_frame.lua index a95c85b..9fcb42c 100644 --- a/search_frame.lua +++ b/search_frame.lua @@ -839,9 +839,20 @@ function public.start_search(filter_string) end end, on_read_auction = function(auction_info) - if getn(scanned_records) < 1000 then -- TODO static popup, remove discard + if getn(scanned_records) == 0 then + SetCVar('MasterSoundEffects', 0) + SetCVar('MasterSoundEffects', 1) + PlaySoundFile([[Interface\AddOns\Aux-AddOn\Event_wardrum_ogre.ogg]], 'Master') + PlaySoundFile([[Interface\AddOns\Aux-AddOn\scourge_horn.ogg]], 'Master') tinsert(scanned_records, auction_info) + private.results_listing:SetDatabase() + Aux.control.on_next_update(function() + Aux.scan.abort('list') + end) end +-- if getn(scanned_records) < 1000 then -- TODO static popup, remove discard +-- tinsert(scanned_records, auction_info) +-- end end, on_complete = function() private.results_listing:SetDatabase() @@ -850,6 +861,8 @@ function public.start_search(filter_string) private.stop_button:Hide() private.search_button:Show() + + public.start_search(filter_string) end, on_abort = function() private.results_listing:SetDatabase()