improvement for buying/cancelling mechanism

This commit is contained in:
Manuel Simon Hirsig
2016-04-24 05:33:17 +02:00
parent 1bbfe99557
commit 12e8a2045b
2 changed files with 38 additions and 34 deletions
+1 -28
View File
@@ -105,32 +105,6 @@ function private.record_remover(record)
end
end
do
local found_index
function private.find_auction(record)
if not Aux.util.index_of(record, auction_records) then
return
end
found_index = nil
Aux.scan_util.find(record, private.status_bar, Aux.util.pass, private.record_remover(record), function(index)
found_index = index
private.cancel_button:SetScript('OnClick', function()
if private.test(record)(index) and Aux.util.index_of(record, auction_records) then
CancelAuction(index)
private.record_remover(record)()
end
end)
private.cancel_button:Enable()
end)
end
end
do
local scan_id
local IDLE, SEARCHING, FOUND = {}, {}, {}
@@ -160,8 +134,7 @@ do
private.cancel_button:SetScript('OnClick', function()
if private.test(record)(index) and private.listing:ContainsRecord(record) then
CancelAuction(index)
private.record_remover(record)()
Aux.cancel_auction(index, private.record_remover(record))
end
end)
private.cancel_button:Enable()