From 898a027a77d0ef5c7864f03830f39814e248ea5c Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Fri, 17 Aug 2018 10:25:12 -0400 Subject: [PATCH] numeric messages are now printed in full instead of just the first char. --- README.md | 6 ++++-- init.lua | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3ee0a57..7ddc4c7 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ Simply place one or more panels, and set a channel on just the left-most or uppe Then send a character, a string, or one of several control words or codes to that channel from a Mesecons Lua Controller and the mod will try to display it. -A single character will be displayed on the connected panel. A numeric message (i.e. not a string) will display the first digit on the connected panel. +A single character will be displayed on the connected panel. -Strings will be displayed using all panels in a lineup, so long as they all face the same way, starting from the panel the Lua Controller is connected to, going left to right. The other panels in the line do not need to be connected to anything - think of them as being connected together internally. Only the panel at the far left need be connected to the Lua Controller. +A numeric message (i.e. not a string) will be converted into a string. + +Strings of all types (other than the keywords below) will be displayed using all panels in a lineup, so long as they all face the same way, starting from the panel the Lua Controller is connected to, going left to right. The other panels in the line do not need to be connected to anything - think of them as being connected together internally. Only the panel at the far left need be connected to the Lua Controller. The string will spread down the line until either a panel is found that faces the wrong way, or has a channel that's not empty/nil and is set to something other than what the first is set to, or if a node is encountered that is not an alpha-numeric panel at all. diff --git a/init.lua b/init.lua index 4167158..f69dd47 100644 --- a/init.lua +++ b/init.lua @@ -220,11 +220,7 @@ local on_digiline_receive_string = function(pos, node, channel, msg) end end elseif msg and type(msg) == "number" then - if msg == 0 then - minetest.swap_node(pos, { name = "led_marquee:char_32", param2 = fdir + (last_color*8)}) - elseif msg > 30 then - minetest.swap_node(pos, { name = "led_marquee:char_"..tostring(msg), param2 = fdir + (last_color*8)}) - end + led_marquee.display_msg(pos, channel, tostring(msg)) end end