From 29bd099067f339b6227e4d839b0df92a34e62be2 Mon Sep 17 00:00:00 2001 From: cheapie Date: Tue, 23 Apr 2024 20:01:11 -0500 Subject: Initial work on remote monitoring software for the laptop mod No scrolling yet (so you can only see 10 floors) and also no dispatcher UI yet (only the controller) --- controllerfw.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'controllerfw.lua') diff --git a/controllerfw.lua b/controllerfw.lua index 62ae939..979df8a 100644 --- a/controllerfw.lua +++ b/controllerfw.lua @@ -655,6 +655,26 @@ elseif event.type == "dispatchermsg" then mem.fs1switch = event.msg mem.fs1led = event.msg end +elseif event.type == "remotemsg" then + if event.channel == "groupupcall" and mem.carstate == "normal" then + mem.groupupcalls[event.msg] = true + elseif event.channel == "groupdncall" and mem.carstate == "normal" then + mem.groupdncalls[event.msg] = true + elseif event.channel == "swingupcall" and mem.carstate == "normal" then + mem.swingupcalls[event.msg] = true + elseif event.channel == "swingdncall" and mem.carstate == "normal" then + mem.swingdncalls[event.msg] = true + elseif event.channel == "upcall" and mem.carstate == "normal" then + mem.upcalls[event.msg] = true + elseif event.channel == "dncall" and mem.carstate == "normal" then + mem.dncalls[event.msg] = true + elseif event.channel == "groupupcancel" then + mem.groupupcalls[event.msg] = nil + elseif event.channel == "groupdncancel" then + mem.groupdncalls[event.msg] = nil + elseif event.channel == "carcall" and mem.carstate == "normal" then + mem.carcalls[event.msg] = true + end end local oldstate = mem.carstate @@ -1025,7 +1045,7 @@ elseif mem.screenstate == "status" then local ypos = 11-(i*0.9) local floornum = bottom+i if floornum > maxfloor then break end - fs(string.format("label[11.25,%f;%s]",ypos,mem.params.floornames[floornum])) + fs(string.format("label[11.25,%f;%s]",ypos,minetest.formspec_escape(mem.params.floornames[floornum]))) local ccdot = mem.carcalls[floornum] and "*" or "" if getpos() == floornum then local cargraphics = { -- cgit v1.2.3