Commit Graph

61 Commits

Author SHA1 Message Date
OgelGames
caf6e24d04 fix crash when "scroll_speed" is not a number 2020-09-09 19:22:14 +10:00
Vanessa Dannenberg
45c89704f0 Add lag mitigation
All messages sent to the displays are firstr enqueued, then "played
back" on globalstep, similar to biome_lib's deferred-generation method.

By default, no more than 10 messages will be added to the queue.  If the
queue should exceed that, old messages will be deleted to make room for
new messages.

Messages will be pulled from the queue, one item per server tick, in the
order received, and relayed to their displays, if dtime <= 0.2s.  If
dtime is greater, messages will be withheld until it decreases.

Autoscroll now limits the speed to 0.5s per step.
2019-08-21 19:34:07 -04:00
flux
db78e3dcdb add check to prevent bad unicode from crashing the server 2019-07-06 02:17:06 +00:00
Vanessa Dannenberg
da1deecb4c use masking:
glyph images are now used as masks over the "leds_on" image
instead of the glyphs themselves looking like they're made of LEDs.

Makes font files much simpler, easier to draw, makes LEDs easier
to re-texture.

White for "on" LEDs, black for "off"

Also optimized all images (optipng, pngcrush)
2019-05-25 03:52:00 -04:00
Vanessa Dannenberg
df30ce9477 Use hardware overlay instead of an extra face
to display the LEDs, gets rid of Z fighting due
to Irrlicht rounding errors
2019-05-25 03:00:14 -04:00
Emiel van Rooijen
4880b5c0c3 Added protection to marquee channel setup formspec 2019-03-24 19:58:23 +01:00
Vanessa Dannenberg
589ab5f19a don't reset scroll position if re-printing the same message 2018-08-22 18:40:58 -04:00
Vanessa Dannenberg
1b2e898615 remove debug prints 2018-08-21 05:48:41 -04:00
Vanessa Dannenberg
2d74ccf8e6 fix the fix ;) 2018-08-21 04:59:58 -04:00
Vanessa Dannenberg
3f98601875 fix glitch where first byte of msg gets skipped on scroll
(causes color code to be displayed raw)
2018-08-21 04:47:00 -04:00
Vanessa Dannenberg
cf94878a46 consolidate timer sanity checking into led_marquee.set_timer 2018-08-21 04:22:22 -04:00
Vanessa Dannenberg
0bc150e64a reduce allowed minimum timeout to 0.2s 2018-08-21 04:15:37 -04:00
Vanessa Dannenberg
f5512c4837 wield image 2018-08-21 00:27:07 -04:00
Vanessa Dannenberg
f7155b385e don't forget to increment the string index for unrecognized chars 2018-08-20 21:33:04 -04:00
Vanessa Dannenberg
4c804e1851 forgot to lowercase chars in color codes table 2018-08-20 20:58:10 -04:00
Vanessa Dannenberg
3ba2dbd1bd use string.char(10) for newline, like it should be
(since colors are now strings)
2018-08-20 20:25:44 -04:00
Vanessa Dannenberg
452102cc7c use printable strings for color codes
instead of string.char(0-27), use "/" as an escape followed by
"[0-9][A-R][a-r]", all inside the string.

e.g. digiline_send("chan", "/0this /1is /2some /3colorful /4text")

"/" followed by any other character than the above will be treated as an
invalid color code and will be taken literally.

"//" will print a single slash.

Note: on receipt, all instances of "//" in a message are actually
translated to string.char(30) -- one for each pair.  This makes the
scrolling code easier.  Keep this in mind if you use the "getstr" and
"getindex" commands.

Also, this expands the max string length to 6 kB, to allow a full 80x25
display with one color code er character.  "clear" and "allon" remain at
2kB since that's still enough.
2018-08-20 20:24:31 -04:00
Vanessa Dannenberg
bee8d5c32d increase string limit to 4 kB
(also pad "clear" and "allon" strings to 2 kB)
2018-08-19 02:06:00 -04:00
Vanessa Dannenberg
65a22e1c8e drop support for "off_multi" (just use "clear")
renamed "allon_multi" to "allon"
2018-08-17 17:14:55 -04:00
Vanessa Dannenberg
c703dbfa74 add optional stepping value to "scroll_step" 2018-08-17 17:12:49 -04:00
Vanessa Dannenberg
0cacd9af9c fix fencepost error 2018-08-17 15:43:41 -04:00
Vanessa Dannenberg
06b419a905 track colors properly in scrolling text
(also fixes timing glitches)
2018-08-17 15:24:21 -04:00
Vanessa Dannenberg
010dab660b don't reset index to 1 on timer-start
(that's handled elsewhere)

also, pre-increment the index so that it matches what's displayed
2018-08-17 11:42:16 -04:00
Vanessa Dannenberg
5826209f16 always reset the scroll index to 1 on any new displayed message 2018-08-17 11:20:49 -04:00
Vanessa Dannenberg
b25b3ef995 use proper form of digilines.receptor_send() 2018-08-17 11:17:27 -04:00
Vanessa Dannenberg
b8a0f1cbb7 fix getindex 2018-08-17 11:03:07 -04:00
Vanessa Dannenberg
3d5380ef25 only reset the scroll index when starting the timer
(not when stopping it)
2018-08-17 10:48:33 -04:00
Vanessa Dannenberg
3df1e6454b add "getindex" command to read the stored message's scroll index position
that is, the string index position of the first displayed character thereof.
2018-08-17 10:46:49 -04:00
Vanessa Dannenberg
4af469f1aa check for "get" and "get_string" in the right place :-P 2018-08-17 10:36:20 -04:00
Vanessa Dannenberg
d9499481cf clarify "get" command 2018-08-17 10:34:40 -04:00
Vanessa Dannenberg
1823b6f0e5 get_str will now get the last displayed string from the master's meta
(instead of only the first char)
2018-08-17 10:33:48 -04:00
Vanessa Dannenberg
02216ee611 store single-byte messages in the meta also 2018-08-17 10:29:10 -04:00
Vanessa Dannenberg
10dcad8e06 store numeric message as a string in the master's meta 2018-08-17 10:27:27 -04:00
Vanessa Dannenberg
898a027a77 numeric messages are now printed in full
instead of just the first char.
2018-08-17 10:25:12 -04:00
Vanessa Dannenberg
922efe9210 clarify README regarding scrolling
also make sure to `return false` from the scroll_text function if the
scroll timer was last set to a value below the allowed minimum (which
would mean the user/program intended to shut it off by setting it to 0,
or the stepper was called manually, implying no timer)
2018-08-17 10:12:35 -04:00
Vanessa Dannenberg
81a06dc054 add a command to immediately scroll the displayed message by one step
to be used in lieu of the three existing auto-scroll commands in case
you want the LuaC to handle the stepping.
2018-08-17 09:49:26 -04:00
Vanessa Dannenberg
3cee6172ae brain-o 2018-08-17 00:49:18 -04:00
Vanessa Dannenberg
053ee765c0 drop support for "off", "colon", "period", "del", "all_on" and "cursor" keywords
(use the actuall ascii chars instead, they do the same thing anyways, but can be part of a string)
2018-08-16 23:50:26 -04:00
Vanessa Dannenberg
57d4c99eb8 add "clear" as more readable an alternate to "off_multi" 2018-08-16 23:41:40 -04:00
Vanessa Dannenberg
244b5011a1 move "allon_multi" and "off_multi" checks to main eval section 2018-08-16 23:40:35 -04:00
Vanessa Dannenberg
3141aa5ba7 basic automatic horizontal scrolling support 2018-08-16 23:35:51 -04:00
Vanessa Dannenberg
ce9666cc48 local-ize functions 2018-08-16 13:22:02 -04:00
Vanessa Dannenberg
4d1d90cccc local-ize iso_chars 2018-08-16 13:21:28 -04:00
Vanessa Dannenberg
ee77614b97 treat strings prefixed with 0xff as Lua's weird UTF-8 encoding
translate them to bare ISO-8859-1 at print time

Only alters chars with codes > 0x9f, so graphics/symbols in the
0x7f-0x9f range and color and control codes < 0x20 are preserved

The routine assumes that any char code > 0x9f is the first byte of a
two-byte UTF-8 symbol.

Note that due to Minetest's busted formspecs, it's not possible to
actually type-in or copy-paste proper UTF strings to take advantage of
this mode, so it's only useful if the strings are generated by or
imported in from something else (e.g. a URL or something, or a LuaC
program that generates strings)
2018-08-16 13:14:27 -04:00
Vanessa Dannenberg
b9a0656407 Added a "cursor position" command byte
updated README
2018-08-16 02:25:31 -04:00
Vanessa Dannenberg
4bb68ec009 basic multi-line support
Stack up a wall of LED panels, any horizontal and vertical amount

Set a channel on the upper left panel, leave the others un-set, and
connect a LuaC to it via digilines.

Long strings sent to that channel will be displayed using all panels,
starting at the upper-left and working from left to right, top to
bottom, wrapping from line to line as appropriate (similar to printing
to a shell terminal).

string.char(28) can be inserted anywhere to force a linefeed.

As usual, printing continues from node to node until the program either
finds a panel with a different non-empty channel than the first one, or
it finds a panel that's facing the wrong way.

If the program finds something other than a panel, it wraps to the next
line.  If it finds something other than a panel twice in a row, that
signals that text has wrapped off of the last row, and printing is cut
off.

Lines of panels don't need to be the same length, the program will wrap
as needed.

This commit also gets rid of the end-of-line padding, uses proper
string.rep() to create the all-off and all-on fills (each of which is
1kB), and fixes one or two other minor issues.

Strings are trimmed to 1 kB.

Panels are not erased between prints.
2018-08-16 01:46:03 -04:00
Vanessa Dannenberg
d182766236 reduce color palette to 28 entries to make room for future control codes
(loses a dupe brown entry, and light blue and pink, which don't really work
well on a LED display)
2018-08-15 19:32:56 -04:00
Vanessa Dannenberg
4fa6d54a4b fix undefined fdir in one spot
make some vars more readable
consolidate/cache fdir usage
2018-08-15 18:53:58 -04:00
Vanessa Dannenberg
157e517663 rename palette 2018-08-15 18:35:29 -04:00
Vanessa Dannenberg
e622f94dfc Merge branch 'led_marquee_gettext' into 'master'
Change intlib Getter (deprecated) to make_gettext_pair.

See merge request VanessaE/led_marquee!1
2018-08-15 22:13:43 +00:00