refactoring
This commit is contained in:
@@ -63,12 +63,6 @@ function private.test(record)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.record_remover(record)
|
|
||||||
return function()
|
|
||||||
m.listing:RemoveAuctionRecord(record)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
do
|
do
|
||||||
local scan_id = 0
|
local scan_id = 0
|
||||||
local IDLE, SEARCHING, FOUND = {}, {}, {}
|
local IDLE, SEARCHING, FOUND = {}, {}, {}
|
||||||
@@ -90,7 +84,7 @@ do
|
|||||||
end,
|
end,
|
||||||
function()
|
function()
|
||||||
state = IDLE
|
state = IDLE
|
||||||
m.record_remover(record)()
|
m.listing:RemoveAuctionRecord(record)
|
||||||
end,
|
end,
|
||||||
function(index)
|
function(index)
|
||||||
state = FOUND
|
state = FOUND
|
||||||
@@ -98,7 +92,7 @@ do
|
|||||||
|
|
||||||
m.cancel_button:SetScript('OnClick', function()
|
m.cancel_button:SetScript('OnClick', function()
|
||||||
if m.test(record)(index) and m.listing:ContainsRecord(record) then
|
if m.test(record)(index) and m.listing:ContainsRecord(record) then
|
||||||
Aux.cancel_auction(index, m.record_remover(record))
|
Aux.cancel_auction(index, Aux.f(m.listing.RemoveAuctionRecord, m.listing, record))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
m.cancel_button:Enable()
|
m.cancel_button:Enable()
|
||||||
|
|||||||
+3
-9
@@ -63,12 +63,6 @@ function private.test(record)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.record_remover(record)
|
|
||||||
return function()
|
|
||||||
m.listing:RemoveAuctionRecord(record)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
do
|
do
|
||||||
local scan_id = 0
|
local scan_id = 0
|
||||||
local IDLE, SEARCHING, FOUND = {}, {}, {}
|
local IDLE, SEARCHING, FOUND = {}, {}, {}
|
||||||
@@ -90,7 +84,7 @@ do
|
|||||||
end,
|
end,
|
||||||
function()
|
function()
|
||||||
state = IDLE
|
state = IDLE
|
||||||
m.record_remover(record)()
|
m.listing:RemoveAuctionRecord(record)
|
||||||
end,
|
end,
|
||||||
function(index)
|
function(index)
|
||||||
state = FOUND
|
state = FOUND
|
||||||
@@ -102,7 +96,7 @@ do
|
|||||||
Aux.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()
|
||||||
Aux.info.bid_update(record)
|
Aux.info.bid_update(record)
|
||||||
m.listing:SetDatabase()
|
m.listing:SetDatabase()
|
||||||
end or m.record_remover(record))
|
end or Aux.f(m.listing.RemoveAuctionRecord, m.listing, record))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
m.bid_button:Enable()
|
m.bid_button:Enable()
|
||||||
@@ -111,7 +105,7 @@ do
|
|||||||
if record.buyout_price > 0 then
|
if record.buyout_price > 0 then
|
||||||
m.buyout_button:SetScript('OnClick', function()
|
m.buyout_button:SetScript('OnClick', function()
|
||||||
if m.test(record)(index) and m.listing:ContainsRecord(record) then
|
if m.test(record)(index) and m.listing:ContainsRecord(record) then
|
||||||
Aux.place_bid('bidder', index, record.buyout_price, m.record_remover(record))
|
Aux.place_bid('bidder', index, record.buyout_price, Aux.f(m.listing.RemoveAuctionRecord, m.listing, record))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
m.buyout_button:Enable()
|
m.buyout_button:Enable()
|
||||||
|
|||||||
+3
-13
@@ -499,16 +499,6 @@ function private.test(record)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.record_remover(table, record)
|
|
||||||
return function()
|
|
||||||
table:RemoveAuctionRecord(record)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function private.record_bid_updater(record)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
do
|
do
|
||||||
local scan_id = 0
|
local scan_id = 0
|
||||||
local IDLE, SEARCHING, FOUND = {}, {}, {}
|
local IDLE, SEARCHING, FOUND = {}, {}, {}
|
||||||
@@ -532,7 +522,7 @@ do
|
|||||||
end,
|
end,
|
||||||
function()
|
function()
|
||||||
state = IDLE
|
state = IDLE
|
||||||
m.record_remover(search.table, record)()
|
search.table:RemoveAuctionRecord(record)
|
||||||
end,
|
end,
|
||||||
function(index)
|
function(index)
|
||||||
if Aux.safe(search.table:GetSelection()).record/nil ~= record then
|
if Aux.safe(search.table:GetSelection()).record/nil ~= record then
|
||||||
@@ -548,7 +538,7 @@ do
|
|||||||
Aux.place_bid('list', index, record.bid_price, record.bid_price < record.buyout_price and function()
|
Aux.place_bid('list', index, record.bid_price, record.bid_price < record.buyout_price and function()
|
||||||
Aux.info.bid_update(record)
|
Aux.info.bid_update(record)
|
||||||
search.table:SetDatabase()
|
search.table:SetDatabase()
|
||||||
end or m.record_remover(search.table, record))
|
end or Aux.f(search.table.RemoveAuctionRecord, search.table, record))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
m.bid_button:Enable()
|
m.bid_button:Enable()
|
||||||
@@ -557,7 +547,7 @@ do
|
|||||||
if record.buyout_price > 0 then
|
if record.buyout_price > 0 then
|
||||||
m.buyout_button:SetScript('OnClick', function()
|
m.buyout_button:SetScript('OnClick', function()
|
||||||
if m.test(record)(index) and search.table:ContainsRecord(record) then
|
if m.test(record)(index) and search.table:ContainsRecord(record) then
|
||||||
Aux.place_bid('list', index, record.buyout_price, m.record_remover(search.table, record))
|
Aux.place_bid('list', index, record.buyout_price, Aux.f(search.table.RemoveAuctionRecord, search.table, record))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
m.buyout_button:Enable()
|
m.buyout_button:Enable()
|
||||||
|
|||||||
Reference in New Issue
Block a user