mirror of
https://github.com/mt-mods/led_marquee.git
synced 2024-11-24 00:03:47 +01:00
reduce allowed minimum timeout to 0.2s
This commit is contained in:
parent
f9f68d13ab
commit
0bc150e64a
@ -49,7 +49,7 @@ The panels also respond to these control messages:
|
|||||||
|
|
||||||
As it advances through the message, the scroll code will search through the message for a printable character, on each scroll step, basically stripping-out color code, and using just the last one before the new start position. This is done in order to keep a constant visible speed (the text will still be colored properly though).
|
As it advances through the message, the scroll code will search through the message for a printable character, on each scroll step, basically stripping-out color code, and using just the last one before the new start position. This is done in order to keep a constant visible speed (the text will still be colored properly though).
|
||||||
* "stop_scroll" does just what it says - it stops the auto-scroll timer.
|
* "stop_scroll" does just what it says - it stops the auto-scroll timer.
|
||||||
* "scroll_speed" followed by a decimal number (in the string, not a byte value) sets the time between scroll steps. Minimum 0.5s, maximum 5s.
|
* "scroll_speed" followed by a decimal number (in the string, not a byte value) sets the time between scroll steps. Minimum 0.2s, maximum 5s.
|
||||||
* "scroll_step" will immediately advance the last-displayed message by one character. Omit the above automatic scrolling keywords, and use ONLY this keyword instead if you want to let your LuaController control the scrolling speed. Optionally, you can follow this with a number and the scroll code will skip forward that many bytes into the message, starting from the current position, before starting the above-mentioned color-vs-character search. Essentially, this value will roughly translate to the number of printable characters to skip.
|
* "scroll_step" will immediately advance the last-displayed message by one character. Omit the above automatic scrolling keywords, and use ONLY this keyword instead if you want to let your LuaController control the scrolling speed. Optionally, you can follow this with a number and the scroll code will skip forward that many bytes into the message, starting from the current position, before starting the above-mentioned color-vs-character search. Essentially, this value will roughly translate to the number of printable characters to skip.
|
||||||
* "get" will read the one character (as a numerical character value) currently displayed by the master panel (by reading its node name)
|
* "get" will read the one character (as a numerical character value) currently displayed by the master panel (by reading its node name)
|
||||||
* "getstr" will read the last-stored message for the entire lineup/wall (from the master panel's meta). Note that even if the message has been or is being scrolled, you'll get the original stored message.
|
* "getstr" will read the last-stored message for the entire lineup/wall (from the master panel's meta). Note that even if the message has been or is being scrolled, you'll get the original stored message.
|
||||||
|
6
init.lua
6
init.lua
@ -183,7 +183,7 @@ led_marquee.scroll_text = function(pos, elapsed, skip)
|
|||||||
|
|
||||||
led_marquee.display_msg(pos, channel, "/"..colorchar..string.sub(msg, f)..string.rep(" ", skip + 1))
|
led_marquee.display_msg(pos, channel, "/"..colorchar..string.sub(msg, f)..string.rep(" ", skip + 1))
|
||||||
meta:set_int("index", f)
|
meta:set_int("index", f)
|
||||||
if not elapsed or elapsed < 0.5 then return false end
|
if not elapsed or elapsed < 0.2 then return false end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -318,14 +318,14 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
|
|||||||
meta:set_int("index", 1)
|
meta:set_int("index", 1)
|
||||||
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.2 or timeout > 5 then timeout = 0 end
|
||||||
led_marquee.set_timer(pos, timeout)
|
led_marquee.set_timer(pos, timeout)
|
||||||
elseif msg == "stop_scroll" then
|
elseif msg == "stop_scroll" then
|
||||||
led_marquee.set_timer(pos, 0)
|
led_marquee.set_timer(pos, 0)
|
||||||
return
|
return
|
||||||
elseif string.sub(msg, 1, 12) == "scroll_speed" then
|
elseif string.sub(msg, 1, 12) == "scroll_speed" then
|
||||||
local timeout = tonumber(string.sub(msg, 13))
|
local timeout = tonumber(string.sub(msg, 13))
|
||||||
if not timeout or timeout < 0.5 or timeout > 5 then timeout = 0 end
|
if not timeout or timeout < 0.2 or timeout > 5 then timeout = 0 end
|
||||||
meta:set_int("timeout", timeout)
|
meta:set_int("timeout", timeout)
|
||||||
led_marquee.set_timer(pos, timeout)
|
led_marquee.set_timer(pos, timeout)
|
||||||
elseif string.sub(msg, 1, 11) == "scroll_step" then
|
elseif string.sub(msg, 1, 11) == "scroll_step" then
|
||||||
|
Loading…
Reference in New Issue
Block a user