1
0
mirror of https://github.com/mt-mods/led_marquee.git synced 2025-06-29 23:00:56 +02:00

add "getindex" command to read the stored message's scroll index position

that is, the string index position of the first displayed character thereof.
This commit is contained in:
Vanessa Dannenberg
2018-08-17 10:46:49 -04:00
parent e8c0fa93ca
commit 3df1e6454b
2 changed files with 3 additions and 0 deletions

View File

@ -205,6 +205,8 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
digiline:receptor_send(pos, digiline.rules.default, channel, tonumber(string.match(minetest.get_node(pos).name,"led_marquee:char_(.+)"))) -- wonderfully horrible string manipulaiton
elseif msg == "getstr" then -- get the last stored message
digiline:receptor_send(pos, digiline.rules.default, channel, meta:get_string("last_msg"))
elseif msg == "getindex" then -- get the last stored message
digiline:receptor_send(pos, digiline.rules.default, channel, meta:get_string("index"))
else
led_marquee.set_timer(pos, 0)
meta:set_string("last_msg", msg)