This commit is contained in:
Andrew6810
2023-03-30 12:32:45 -07:00
parent f3e579cb57
commit d6aaac97af
53 changed files with 2930 additions and 1307 deletions
@@ -222,6 +222,7 @@ L["Round Normal Price"] = true
L["Running Scan..."] = true
L["Save New Price"] = true
L["Scan Complete!"] = true
L["Scanning %d / %d (Page 1 / ?)"] = true
L["Scanning %d / %d (Page %d / %d)"] = true
L["Scanning %d / %d"] = true
L["ScrollWheel Direction (both recommended):"] = true
@@ -210,6 +210,7 @@ L["Right-Click to add %s to your friends list."] = "Clic-droit pour ajouter %s
-- L["Save New Price"] = ""
L["Scan Complete!"] = "Scan terminé !" -- Needs review
L["Scanning %d / %d"] = "Scan %d / %d" -- Needs review
L["Scanning %d / %d (Page 1 / ?)"] = "Scan %d / %d (Page 1 / ?)" -- Needs review
L["Scanning %d / %d (Page %d / %d)"] = "Scan %d / %d (Page %d / %d)" -- Needs review
L["ScrollWheel Direction (both recommended):"] = "Direction de la molette (les deux sont recommandées)"
-- L["Select a duration in this dropdown and click on the button below to cancel all auctions at or below this duration."] = ""
@@ -210,6 +210,7 @@ L["Running Scan..."] = "검색 진행 중..." -- Needs review
L["Save New Price"] = "새 가격 저장" -- Needs review
L["Scan Complete!"] = "검색 완료!" -- Needs review
L["Scanning %d / %d"] = "검색 중 %d / %d" -- Needs review
L["Scanning %d / %d (Page 1 / ?)"] = "검색 중 %d / %d (페이지 1 / ?)" -- Needs review
L["Scanning %d / %d (Page %d / %d)"] = "검색 중 %d / %d (페이지 %d / %d)" -- Needs review
L["ScrollWheel Direction (both recommended):"] = "스크롤휠 방향 (둘다 체크 추천)"
L["Select a duration in this dropdown and click on the button below to cancel all auctions at or below this duration."] = "이 드롭다운에서 기간을 선택하고 아래의 버튼을 클릭하면 지정한 기간 또는 그 이하의 모든 경매는 취소됩니다." -- Needs review
@@ -215,6 +215,7 @@ L["Running Scan..."] = "Запуск скана..."
L["Save New Price"] = "Сохр.новую цену"
L["Scan Complete!"] = "Скан завершен!"
L["Scanning %d / %d"] = "Скан %d / %d"
L["Scanning %d / %d (Page 1 / ?)"] = "Скан %d / %d (стр 1 / ?)"
L["Scanning %d / %d (Page %d / %d)"] = "Скан %d / %d (стр %d / %d)"
L["ScrollWheel Direction (both recommended):"] = "Направление прокрутки колесика (рекомендованы оба):"
L["Select a duration in this dropdown and click on the button below to cancel all auctions at or below this duration."] = "Выберите длительность из списка и кликните на кнопку ниже, чтобы отменить все акционы ниже этой длительности."
@@ -216,6 +216,7 @@ L["Running Scan..."] = "扫描中..."
L["Save New Price"] = "保存新价格"
L["Scan Complete!"] = "扫描完成!"
L["Scanning %d / %d"] = "扫描中 %d/%d"
L["Scanning %d / %d (Page 1 / ?)"] = "扫描中 %d / %d (第1/?页)"
L["Scanning %d / %d (Page %d / %d)"] = "扫描中 %d / %d (第%d/%d页)"
L["ScrollWheel Direction (both recommended):"] = "滚轮方向 (建议都选):"
L["Select a duration in this dropdown and click on the button below to cancel all auctions at or below this duration."] = "在本下拉列表中选择一个期限,然后点击下面的按钮来取消低于这个时间的拍卖。"
@@ -17,10 +17,6 @@ Scan.skipped = {}
local function CallbackHandler(event, ...)
if event == "QUERY_COMPLETE" then
local filterList = ...
local numItems = 0
for _, v in ipairs(filterList) do
numItems = numItems + #v.items
end
Scan.filterList = filterList
Scan.numFilters = #filterList
Scan:ScanNextFilter()
@@ -32,8 +28,19 @@ local function CallbackHandler(event, ...)
tinsert(Scan.skipped, itemString)
end
elseif event == "SCAN_PAGE_UPDATE" then
-- Simply forward the "currently received" and "total" page counts
-- for the current item we're scanning.
-- NOTE: Private servers sometimes give totally insane "total page counts"
-- on the first response, such as "page 1/142", but those server errors
-- always correct themselves to "page 2/REAL" when the scan has reached
-- page 2. There's nothing we can do to avoid that rare page-count issue
-- (which happens on many popular private servers, such as Warmane).
TSM.Manage:UpdateStatus("page", ...)
elseif event == "SCAN_INTERRUPTED" then
elseif event == "SCAN_INTERRUPTED" or event == "INTERRUPTED" then
-- We've been interrupted by the Auction House closing.
-- NOTE: "SCAN_INTERRUPTED" is from LibAuctionScan-1.0, which isn't used
-- by TSM anymore, and "INTERRUPTED" is from "TSM/Auction/AuctionScanning.lua",
-- which is what this scanner uses nowadays.
TSM.Manage:ScanComplete(true)
elseif event == "SCAN_TIMEOUT" then
tremove(Scan.filterList, 1)
@@ -60,6 +67,16 @@ function Scan:StartItemScan(itemList)
end
function Scan:ScanNextFilter()
-- We must reset the page counter, otherwise the next scan will keep the
-- page count of the previous item until we receive "SCAN_PAGE_UPDATE".
-- NOTE: The "nil" signals that we don't know the item's page count yet.
-- NOTE: The recipient may want to ignore "page" events that have nil values
-- and not update their status bars based on those, since we send these empty
-- page events before we start each new scan!
TSM.Manage:UpdateStatus("page", nil, nil)
-- Now update the scan counter.
-- NOTE: Our scan progress counter below starts counting from 0 as the first item.
if #Scan.filterList == 0 then
TSM.Manage:UpdateStatus("scan", Scan.numFilters, Scan.numFilters)
return TSM.Manage:ScanComplete()
+27 -8
View File
@@ -85,6 +85,9 @@ end
function Manage:ScanComplete(interrupted)
if interrupted then
-- If our scan has been interrupted by the Auction House closing,
-- simply act as if the user clicked "Stop", but with an extra flag
-- to also clarify that this was interrupted.
Util:Stop(true)
else
local numToManage = Util:DoneScanning()
@@ -106,24 +109,40 @@ local function IsStepDone(step)
end
-- update the statusbar
function Manage:UpdateStatus(statusType, current, total)
-- The ScanUtil.lua events trigger us with the "statusType" and the arguments
-- such as what page we're on. We then update our current scan status based on that.
scanStatus[statusType] = {current, total}
-- Ignore the empty "reset page count" events that happen before every new
-- scan. We've reset the page counts, which is the only thing that matters.
if statusType == "page" and current == nil and total == nil then
return
end
-- Handle the progress event by updating our status bar.
if statusType == "query" then
if total >= 0 then
GUI.statusBar:SetStatusText(format(L["Preparing Filter %d / %d"], current, total))
else
GUI.statusBar:SetStatusText(format(L["Preparing Filters..."], current, total))
end
elseif IsStepDone("scan") and IsStepDone("manage") and IsStepDone("confirm") then -- scan complete
elseif IsStepDone("scan") and IsStepDone("manage") and IsStepDone("confirm") then
-- The entire scan of all items is complete.
GUI.statusBar:SetStatusText(L["Scan Complete!"])
else
local parts = {}
if IsStepDone("scan") then
tinsert(parts, L["Done Scanning"])
elseif IsStepStarted("scan") then
-- NOTE: In the label, we count the items starting at 1, to say
-- "Scanning 1 / 2" (instead of "Scanning 0 / 2").
if IsStepStarted("page") then
tinsert(parts, format(L["Scanning %d / %d (Page %d / %d)"], scanStatus.scan[1], scanStatus.scan[2], scanStatus.page[1], scanStatus.page[2]))
-- We have received the page counter ("current page / total pages") for the current item.
-- NOTE: We add "+1" to the page counter, to indicate that we've received that page and are working on the next page.
tinsert(parts, format(L["Scanning %d / %d (Page %d / %d)"], scanStatus.scan[1] + 1, scanStatus.scan[2], min(scanStatus.page[1] + 1, scanStatus.page[2]), scanStatus.page[2]))
else
tinsert(parts, format(L["Scanning %d / %d"], scanStatus.scan[1], scanStatus.scan[2]))
-- We have started a new item scan but haven't received the page count yet.
tinsert(parts, format(L["Scanning %d / %d (Page 1 / ?)"], scanStatus.scan[1] + 1, scanStatus.scan[2]))
end
end
if IsStepDone("manage") then
@@ -133,25 +152,25 @@ function Manage:UpdateStatus(statusType, current, total)
tinsert(parts, L["Done Canceling"])
end
if IsStepStarted("confirm") then
tinsert(parts, format(L["Confirming %d / %d"], scanStatus.confirm[1]+1, scanStatus.confirm[2]))
tinsert(parts, format(L["Confirming %d / %d"], scanStatus.confirm[1] + 1, scanStatus.confirm[2]))
else
tinsert(parts, format(L["Confirming %d / %d"], 1, scanStatus.manage[2]))
end
elseif IsStepDone("scan") and IsStepStarted("manage") then
if mode == "Post" then
tinsert(parts, format(L["Posting %d / %d"], scanStatus.manage[1]+1, scanStatus.manage[2]))
tinsert(parts, format(L["Posting %d / %d"], scanStatus.manage[1] + 1, scanStatus.manage[2]))
elseif mode == "Cancel" then
tinsert(parts, format(L["Canceling %d / %d"], scanStatus.manage[1]+1, scanStatus.manage[2]))
tinsert(parts, format(L["Canceling %d / %d"], scanStatus.manage[1] + 1, scanStatus.manage[2]))
end
if IsStepStarted("confirm") then
tinsert(parts, format(L["Confirming %d / %d"], scanStatus.confirm[1]+1, scanStatus.confirm[2]))
tinsert(parts, format(L["Confirming %d / %d"], scanStatus.confirm[1] + 1, scanStatus.confirm[2]))
else
tinsert(parts, format(L["Confirming %d / %d"], 1, scanStatus.manage[2]))
end
end
GUI.statusBar:SetStatusText(table.concat(parts, " - "))
end
if IsStepDone("query") then
local scanCurrent = scanStatus.scan and scanStatus.scan[1] or 0
local scanTotal = scanStatus.scan and scanStatus.scan[2] or 1