some polish for the buying process
This commit is contained in:
+2
-2
@@ -282,7 +282,7 @@ function private.find_auction(entry, action, express_mode)
|
||||
|
||||
if express_mode then
|
||||
if GetMoney() >= amount then
|
||||
PlaceAuctionBid('bidder', auction_info.index, amount)
|
||||
Aux.place_bid('bidder', auction_info.index, amount)
|
||||
Aux.log((action == 'buyout' and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' ('..auction_record.aux_quantity..').')
|
||||
entry.gone = true
|
||||
else
|
||||
@@ -293,7 +293,7 @@ function private.find_auction(entry, action, express_mode)
|
||||
public.dialog_action = function()
|
||||
if private.create_record(Aux.info.auction(auction_info.index, 'bidder')).signature == entry.signature then
|
||||
if GetMoney() >= amount then
|
||||
PlaceAuctionBid('bidder', auction_info.index, action == 'bid' and MoneyInputFrame_GetCopper(AuxBidsFrameListingDialogContentBid) or amount)
|
||||
Aux.place_bid('bidder', auction_info.index, action == 'bid' and MoneyInputFrame_GetCopper(AuxBidsFrameListingDialogContentBid) or amount)
|
||||
Aux.log((action == 'buyout' and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' ('..auction_record.aux_quantity..').')
|
||||
entry.gone = true
|
||||
else
|
||||
|
||||
@@ -129,6 +129,17 @@ function Aux_OnAddonLoaded()
|
||||
end
|
||||
end
|
||||
|
||||
function Aux.place_bid(type, index, bid)
|
||||
local money = GetMoney()
|
||||
if money >= bid then
|
||||
Aux.bid_lock = true
|
||||
Aux.control.as_soon_as(function() return GetMoney() < money end, function()
|
||||
Aux.bid_lock = false
|
||||
end)
|
||||
end
|
||||
PlaceAuctionBid(type, index, bid)
|
||||
end
|
||||
|
||||
function Aux.log_frame_load()
|
||||
this:SetFading(false)
|
||||
this:EnableMouseWheel()
|
||||
|
||||
+10
-2
@@ -639,14 +639,22 @@ function find_auction(entry, express_mode, buyout_mode)
|
||||
end
|
||||
|
||||
if express_mode then
|
||||
if Aux.bid_lock then
|
||||
return
|
||||
end
|
||||
|
||||
if GetMoney() >= amount then
|
||||
entry.gone = true
|
||||
end
|
||||
PlaceAuctionBid('list', index, amount)
|
||||
Aux.place_bid('list', index, amount)
|
||||
private.selected = nil
|
||||
refresh = true
|
||||
else
|
||||
private.buyout_button:SetScript('OnClick', function()
|
||||
if Aux.bid_lock then
|
||||
return
|
||||
end
|
||||
|
||||
if not test(index) then
|
||||
private.buyout_button:Disable()
|
||||
return find_auction(entry, express_mode, buyout_mode) -- try again
|
||||
@@ -655,7 +663,7 @@ function find_auction(entry, express_mode, buyout_mode)
|
||||
if GetMoney() >= amount then
|
||||
entry.gone = true
|
||||
end
|
||||
PlaceAuctionBid('list', index, entry.buyout_price)
|
||||
Aux.place_bid('list', index, entry.buyout_price)
|
||||
|
||||
private.buyout_button:Disable()
|
||||
private.selected = nil
|
||||
|
||||
+12
-2
@@ -653,6 +653,7 @@ function find_auction(entry, express_mode, buyout_mode)
|
||||
end
|
||||
|
||||
Aux.scan_util.find_auction(test, search_query, entry.page, private.status_bar, function(index)
|
||||
|
||||
if not index then
|
||||
entry.gone = true
|
||||
private.clear_selection()
|
||||
@@ -665,14 +666,23 @@ function find_auction(entry, express_mode, buyout_mode)
|
||||
end
|
||||
|
||||
if express_mode then
|
||||
if Aux.bid_lock then
|
||||
return
|
||||
end
|
||||
|
||||
if GetMoney() >= amount then
|
||||
entry.gone = true
|
||||
end
|
||||
PlaceAuctionBid('list', index, amount)
|
||||
Aux.place_bid('list', index, amount)
|
||||
|
||||
private.clear_selection()
|
||||
refresh = true
|
||||
else
|
||||
private.buyout_button:SetScript('OnClick', function()
|
||||
if Aux.bid_lock then
|
||||
return
|
||||
end
|
||||
|
||||
if not test(index) then
|
||||
private.buyout_button:Disable()
|
||||
return find_auction(entry, express_mode, buyout_mode) -- try again
|
||||
@@ -681,7 +691,7 @@ function find_auction(entry, express_mode, buyout_mode)
|
||||
if GetMoney() >= amount then
|
||||
entry.gone = true
|
||||
end
|
||||
PlaceAuctionBid('list', index, entry.buyout_price)
|
||||
Aux.place_bid('list', index, entry.buyout_price)
|
||||
|
||||
private.buyout_button:Disable()
|
||||
private.clear_selection()
|
||||
|
||||
Reference in New Issue
Block a user