module refactoring

This commit is contained in:
Manuel Simon Hirsig
2017-11-25 17:53:39 +01:00
parent 6f71167e48
commit ab94acc2be
38 changed files with 402 additions and 453 deletions
+5 -7
View File
@@ -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