module refactoring
This commit is contained in:
+5
-7
@@ -1,14 +1,12 @@
|
||||
module 'aux.tabs.bids'
|
||||
|
||||
include 'aux'
|
||||
|
||||
local T = require 'T'
|
||||
|
||||
local aux = require 'aux'
|
||||
local info = require 'aux.util.info'
|
||||
local scan_util = require 'aux.util.scan'
|
||||
local scan = require 'aux.core.scan'
|
||||
|
||||
local tab = TAB 'Bids'
|
||||
local tab = aux.tab 'Bids'
|
||||
|
||||
auction_records = {}
|
||||
|
||||
@@ -80,7 +78,7 @@ do
|
||||
if not record.high_bidder then
|
||||
bid_button:SetScript('OnClick', function()
|
||||
if scan_util.test(record, index) and listing:ContainsRecord(record) then
|
||||
place_bid('bidder', index, record.bid_price, record.bid_price < record.buyout_price and function()
|
||||
aux.place_bid('bidder', index, record.bid_price, record.bid_price < record.buyout_price and function()
|
||||
info.bid_update(record)
|
||||
listing:SetDatabase()
|
||||
end or function() listing:RemoveAuctionRecord(record) end)
|
||||
@@ -94,7 +92,7 @@ do
|
||||
if record.buyout_price > 0 then
|
||||
buyout_button:SetScript('OnClick', function()
|
||||
if scan_util.test(record, index) and listing:ContainsRecord(record) then
|
||||
place_bid('bidder', index, record.buyout_price, function() listing:RemoveAuctionRecord(record) end)
|
||||
aux.place_bid('bidder', index, record.buyout_price, function() listing:RemoveAuctionRecord(record) end)
|
||||
end
|
||||
end)
|
||||
buyout_button:Enable()
|
||||
@@ -121,7 +119,7 @@ do
|
||||
elseif state == FOUND and not scan_util.test(selection.record, found_index) then
|
||||
buyout_button:Disable()
|
||||
bid_button:Disable()
|
||||
if not bid_in_progress() then state = IDLE end
|
||||
if not aux.bid_in_progress() then state = IDLE end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user