#85 handling supervisor disconnected, bugfix with renderer
This commit is contained in:
parent
e456d34468
commit
397e311f1b
@ -38,7 +38,7 @@ local function _reset_display(monitor, recolor)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- reset all colors
|
-- reset all colors
|
||||||
for _, val in colors do
|
for _, val in pairs(colors) do
|
||||||
-- colors api has constants and functions, just get color constants
|
-- colors api has constants and functions, just get color constants
|
||||||
if type(val) == "number" then
|
if type(val) == "number" then
|
||||||
monitor.setPaletteColor(val, term.nativePaletteColor(val))
|
monitor.setPaletteColor(val, term.nativePaletteColor(val))
|
||||||
|
|||||||
@ -16,7 +16,7 @@ local config = require("coordinator.config")
|
|||||||
local coordinator = require("coordinator.coordinator")
|
local coordinator = require("coordinator.coordinator")
|
||||||
local renderer = require("coordinator.renderer")
|
local renderer = require("coordinator.renderer")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "alpha-v0.4.3"
|
local COORDINATOR_VERSION = "alpha-v0.4.4"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
@ -247,6 +247,17 @@ while ui_ok do
|
|||||||
-- got a packet
|
-- got a packet
|
||||||
local packet = coord_comms.parse_packet(param1, param2, param3, param4, param5)
|
local packet = coord_comms.parse_packet(param1, param2, param3, param4, param5)
|
||||||
coord_comms.handle_packet(packet)
|
coord_comms.handle_packet(packet)
|
||||||
|
|
||||||
|
-- check if it was a disconnect
|
||||||
|
if not coord_comms.is_linked() then
|
||||||
|
-- close connection and UI
|
||||||
|
coord_comms.close()
|
||||||
|
renderer.close_ui()
|
||||||
|
|
||||||
|
-- try to re-connect to the supervisor
|
||||||
|
init_connect_sv()
|
||||||
|
ui_ok = init_start_ui()
|
||||||
|
end
|
||||||
elseif event == "monitor_touch" then
|
elseif event == "monitor_touch" then
|
||||||
-- handle a monitor touch event
|
-- handle a monitor touch event
|
||||||
renderer.handle_touch(core.events.touch(param1, param2, param3))
|
renderer.handle_touch(core.events.touch(param1, param2, param3))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user