Fixed starting message.

This commit is contained in:
Andrew Lalis 2023-07-24 09:56:27 -04:00
parent e175f78431
commit c833571bbc
1 changed files with 14 additions and 7 deletions

View File

@ -273,17 +273,17 @@ local function handleSchematicUrl(url)
os.sleep(2) os.sleep(2)
return return
end end
g.drawText(mon, 1, 8, "Fetching item lists from URL...", colors.lightGray, colors.black) g.drawText(mon, 1, 7, "Fetching item lists from URL...", colors.lightGray, colors.black)
local itemLists, err = fetchItemLists(url) local itemLists, err = fetchItemLists(url)
if not itemLists then if not itemLists then
g.drawText(mon, 1, 9, "Failed to fetch item lists.", colors.red, colors.black) g.drawText(mon, 1, 8, "Failed to fetch item lists.", colors.red, colors.black)
g.drawText(mon, 1, 10, err, colors.red, colors.black) g.drawText(mon, 1, 9, err, colors.red, colors.black)
os.sleep(3) os.sleep(3)
return return
end end
g.drawText(mon, 1, 9, "Got lists for "..(#itemLists).." schematics:", colors.white, colors.black) g.drawText(mon, 1, 8, "Got lists for "..(#itemLists).." schematics:", colors.white, colors.black)
local y = 10 local y = 9
for i, itemList in pairs(itemLists) do for i, itemList in pairs(itemLists) do
local count = itemList.__COUNT__ local count = itemList.__COUNT__
local name = itemList.__NAME__ local name = itemList.__NAME__
@ -298,14 +298,16 @@ local function handleSchematicUrl(url)
-- Draw continue and cancel buttons and wait for user input. -- Draw continue and cancel buttons and wait for user input.
g.fillRect(mon, 1, H-2, 18, 3, colors.gray) g.fillRect(mon, 1, H-2, 18, 3, colors.gray)
g.drawTextCenter(mon, 9, H-1, "Cancel", colors.white) g.drawTextCenter(mon, 9, H-1, "Cancel", colors.white)
g.fillRect(mon, 19, H-2, 20, 3, colors.green) g.fillRect(mon, 19, H-2, 21, 3, colors.green)
g.drawTextCenter(mon, 29, H-1, "Continue", colors.white) g.drawTextCenter(mon, 29, H-1, "Continue", colors.white)
local waiting = true local waiting = true
while waiting do while waiting do
local event, monName, x, y = os.pullEvent("monitor_touch") local event, monName, x, y = os.pullEvent("monitor_touch")
if monName == "monitor_24" and y >= H-2 then if monName == "monitor_24" and y >= H-2 then
if x <= 18 then if x <= 18 then
-- Canceled, so quit the whole application.
playNotes("harp", {12, 8}) playNotes("harp", {12, 8})
RUNNING = false
return return
else else
playNotes("bell", {12, 16}) playNotes("bell", {12, 16})
@ -337,7 +339,12 @@ local function handleSchematicUrl(url)
g.drawText(mon, 17, H-1, "Report", colors.white) g.drawText(mon, 17, H-1, "Report", colors.white)
g.fillRect(mon, 27, H-2, 13, 3, colors.red) g.fillRect(mon, 27, H-2, 13, 3, colors.red)
g.drawText(mon, 31, H-1, "Quit", colors.white) g.drawText(mon, 31, H-1, "Quit", colors.white)
os.sleep(3)
for i = 1, 5 do
g.drawText(mon, 1, H-4, "Starting in "..(5-i+1), colors.white, colors.black)
os.sleep(1)
end
EXPORTING = true EXPORTING = true
local fExport = function() exportSchematics(itemLists) end local fExport = function() exportSchematics(itemLists) end
local fHandleEvents = function() handleExportEvents() end local fHandleEvents = function() handleExportEvents() end