#219 bugfixes with renderer exit handling

This commit is contained in:
Mikayla Fischler
2023-04-21 23:43:28 -04:00
parent 783c4936cc
commit 43e708aa0d
11 changed files with 69 additions and 69 deletions

View File

@@ -40,28 +40,28 @@ end
-- close out the UI
function renderer.close_ui()
-- stop blinking indicators
flasher.clear()
if ui.display ~= nil then
-- stop blinking indicators
flasher.clear()
-- hide to stop animation callbacks
ui.display.hide()
-- clear root UI elements
ui.display = nil
-- restore colors
for i = 1, #style.colors do
local r, g, b = term.nativePaletteColor(style.colors[i].c)
term.setPaletteColor(style.colors[i].c, r, g, b)
end
-- reset terminal
term.setTextColor(colors.white)
term.setBackgroundColor(colors.black)
term.clear()
term.setCursorPos(1, 1)
end
-- clear root UI elements
ui.display = nil
-- restore colors
for i = 1, #style.colors do
local r, g, b = term.nativePaletteColor(style.colors[i].c)
term.setPaletteColor(style.colors[i].c, r, g, b)
end
-- reset terminal
term.setTextColor(colors.white)
term.setBackgroundColor(colors.black)
term.clear()
term.setCursorPos(1, 1)
end
-- is the UI ready?

View File

@@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
local renderer = require("reactor-plc.renderer")
local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "v1.1.16"
local R_PLC_VERSION = "v1.1.17"
local println = util.println
local println_ts = util.println_ts