extended shift-click name copy for the buy tab, generally implemented the buy tab functionality. It's working in principle! but still needs a lot of polish. Also did some refactoring
This commit is contained in:
@@ -4,7 +4,7 @@ local STATE_POSTQUERY = 2
|
||||
|
||||
local NUM_AUCTION_ITEMS_PER_PAGE = 50
|
||||
|
||||
local currentQuery
|
||||
local currentJob
|
||||
local currentPage
|
||||
local state = STATE_IDLE
|
||||
|
||||
@@ -23,27 +23,28 @@ end
|
||||
|
||||
-----------------------------------------
|
||||
|
||||
function Auctionator_Scan_Complete()
|
||||
|
||||
if currentQuery.onComplete then
|
||||
currentQuery.onComplete(scanData)
|
||||
function Auctionator_Scan_Complete()
|
||||
if state ~= STATE_IDLE then
|
||||
if currentJob.onComplete then
|
||||
currentJob.onComplete(scanData)
|
||||
end
|
||||
|
||||
currentJob = nil
|
||||
currentPage = nil
|
||||
scanData = nil
|
||||
state = STATE_IDLE
|
||||
end
|
||||
|
||||
currentQuery = nil
|
||||
currentPage = nil
|
||||
scanData = nil
|
||||
state = STATE_IDLE
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
|
||||
function Auctionator_Scan_Abort()
|
||||
|
||||
if currentQuery and currentQuery.onAbort then
|
||||
currentQuery.onAbort()
|
||||
if currentJob and currentJob.onAbort then
|
||||
currentJob.onAbort()
|
||||
end
|
||||
|
||||
currentQuery = nil
|
||||
currentJob = nil
|
||||
currentPage = nil
|
||||
scanData = nil
|
||||
state = STATE_IDLE
|
||||
@@ -51,7 +52,7 @@ end
|
||||
|
||||
-----------------------------------------
|
||||
|
||||
function Auctionator_Scan_Start(query)
|
||||
function Auctionator_Scan_Start(job)
|
||||
|
||||
Auctionator_SetMessage("Scanning auctions ...")
|
||||
|
||||
@@ -59,7 +60,7 @@ function Auctionator_Scan_Start(query)
|
||||
Auctionator_Scan_Abort()
|
||||
end
|
||||
|
||||
currentQuery = query
|
||||
currentJob = job
|
||||
currentPage = 0
|
||||
scanData = {}
|
||||
state = STATE_PREQUERY
|
||||
@@ -70,7 +71,6 @@ end
|
||||
function Auctionator_Scan_CreateQuery(parameterMap)
|
||||
local query = {
|
||||
name = nil,
|
||||
exactMatch = false,
|
||||
minLevel = "",
|
||||
maxLevel = "",
|
||||
invTypeIndex = nil,
|
||||
@@ -91,15 +91,15 @@ end
|
||||
|
||||
function submitQuery()
|
||||
QueryAuctionItems(
|
||||
currentQuery.name,
|
||||
currentQuery.minLevel,
|
||||
currentQuery.maxLevel,
|
||||
currentQuery.invTypeIndex,
|
||||
currentQuery.classIndex,
|
||||
currentQuery.subclassIndex,
|
||||
currentJob.query.name,
|
||||
currentJob.query.minLevel,
|
||||
currentJob.query.maxLevel,
|
||||
currentJob.query.invTypeIndex,
|
||||
currentJob.query.classIndex,
|
||||
currentJob.query.subclassIndex,
|
||||
currentPage,
|
||||
currentQuery.isUsable,
|
||||
currentQuery.qualityIndex
|
||||
currentJob.query.isUsable,
|
||||
currentJob.query.qualityIndex
|
||||
)
|
||||
state = STATE_POSTQUERY
|
||||
currentPage = currentPage + 1
|
||||
@@ -138,14 +138,14 @@ function processQueryResults()
|
||||
bidAmount = bidAmount,
|
||||
highBidder = highBidder,
|
||||
owner = owner,
|
||||
duration = duration
|
||||
duration = duration,
|
||||
page = currentPage,
|
||||
pageIndex = i
|
||||
}
|
||||
|
||||
if not currentQuery.exactMatch or (currentQuery.name == scanDatum.name and scanDatum.buyoutPrice > 0) then -- TODO separate option for buyout price
|
||||
tinsert(scanData, scanDatum)
|
||||
if currentQuery.onReadDatum then
|
||||
currentQuery.onReadDatum(scanDatum)
|
||||
end
|
||||
tinsert(scanData, scanDatum)
|
||||
if currentJob.onReadDatum then
|
||||
currentJob.onReadDatum(scanDatum)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user