1
0
mirror of https://github.com/mt-mods/led_marquee.git synced 2024-11-14 13:50:21 +01:00

move "allon_multi" and "off_multi" checks to main eval section

This commit is contained in:
Vanessa Dannenberg 2018-08-16 23:40:35 -04:00
parent 3141aa5ba7
commit 244b5011a1

View File

@ -100,11 +100,7 @@ local cbox = {
led_marquee.display_msg = function(pos, channel, msg) led_marquee.display_msg = function(pos, channel, msg)
msg = string.sub(msg, 1, 1024) msg = string.sub(msg, 1, 1024)
if msg == "off_multi" then if string.sub(msg,1,1) == string.char(255) then -- treat it as incoming UTF-8
msg = string.rep(" ", 1024)
elseif msg == "allon_multi" then
msg = string.rep(string.char(144), 1024)
elseif string.sub(msg,1,1) == string.char(255) then -- treat it as incoming UTF-8
msg = make_iso(string.sub(msg, 2, 1024)) msg = make_iso(string.sub(msg, 2, 1024))
end end
@ -193,6 +189,14 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
minetest.swap_node(pos, { name = "led_marquee:char_144", param2 = fdir + (last_color*8)}) minetest.swap_node(pos, { name = "led_marquee:char_144", param2 = fdir + (last_color*8)})
elseif msg == "cursor" then elseif msg == "cursor" then
minetest.swap_node(pos, { name = "led_marquee:char_31", param2 = fdir + (last_color*8)}) minetest.swap_node(pos, { name = "led_marquee:char_31", param2 = fdir + (last_color*8)})
elseif msg == "off_multi" then
msg = string.rep(" ", 1024)
meta:set_string("last_msg", msg)
led_marquee.display_msg(pos, channel, msg)
elseif msg == "allon_multi" then
msg = string.rep(string.char(144), 1024)
meta:set_string("last_msg", msg)
led_marquee.display_msg(pos, channel, msg)
elseif msg == "start_scroll" then elseif msg == "start_scroll" then
local timeout = meta:get_int("timeout") local timeout = meta:get_int("timeout")
if not timeout or timeout < 0.5 or timeout > 5 then timeout = 0 end if not timeout or timeout < 0.5 or timeout > 5 then timeout = 0 end