1
0
mirror of https://github.com/mt-mods/led_marquee.git synced 2025-06-28 22:36:41 +02:00

5 Commits

Author SHA1 Message Date
ec2cfdd87d update README to follow 2018-08-15 18:02:08 -04:00
2faab30e19 basic support for the ISO-8859-1 character set
(sorry, no UTF-8 here, Lue doesn't do multi-byte too well in this situation)
plus a bunch of symbols stuffed into the empty 128-159 range that should be
useful on a marquee:

128,129: musical notes
130-140: box drawing glyphs
141-144: block shades
145-152: arrows
153-156: explosion/splat
157-159: smileys

This commit changes the "all on" keyword to point to char(144), and
"cursor" is moved to char(31).
2018-08-15 17:26:30 -04:00
3a02591d28 fix swapped fdir checks 2018-08-15 14:57:20 -04:00
bd0e7d9bfa fix color range check 2018-08-15 14:28:38 -04:00
06d19f0d2e fix orientation checks
(broke at the 31-color update)
2018-08-15 14:27:55 -04:00
133 changed files with 73 additions and 61 deletions

View File

@ -8,7 +8,7 @@ Simply place a panel, right-click it, and set a channel.
Then send a character, a string, or one of several control words to that channel from a Mesecons Lua Controller and the mod will try to display it. The panels use the standard 7-bit ASCII character set (with a few alterations). Then send a character, a string, or one of several control words to that channel from a Mesecons Lua Controller and the mod will try to display it. The panels use the standard 7-bit ASCII character set (with a few alterations).
A single character will be displayed on the connected panel. 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.
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. 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.
@ -20,14 +20,23 @@ You can put multiple lines of panels end to end to form independent displays, so
The string is padded with spaces and then trimmed to 64 characters. The string is padded with spaces and then trimmed to 64 characters.
Any unrecognized symbol or character outside the ASCII 32 - 129 range, whether part of a string or singularly is ignored, except as noted below. Any unrecognized symbol or character, whether part of a string or singularly is ignored, except as noted below.
This mod uses the full ISO-8859-1 character set (see https://en.wikipedia.org/wiki/ISO/IEC_8859-1 for details), plus a bunch of symbols stuffed into the empty 128-159 range that should be useful on a marquee:
* 128,129: musical notes
* 130-140: box drawing glyphs
* 141-144: block shades
* 145-152: arrows
* 153-156: explosion/splat
* 157-159: smileys
The panels also respond to these control messages: The panels also respond to these control messages:
* the words "off", "colon" and "period" translate to a blank space, ":", and ".", respectively. * the keywords "off", "colon" and "period" translate to a blank space, ":", and ".", respectively (they're leftover from the nixie tubes fork, but might be useful anyway)
* "del" or character code 127 displays a square with an X in it * "del" is mapped to character #127, a square with an X in it.
* "allon" or character code 128 will turn on all LEDs on the panel. * "allon" is mapped to character #144, the full/all-on block graphic.
* "cursor" or character code 129 will display a short, thick line at the bottom of the panel. * "cursor" or character code 31 will display a short, thick, flashing line at the bottom of the panel.
* "off_multi" turns all panels in a lineup off * "off_multi" turns all panels in a lineup off
* "allon_multi" turns on all LEDs of all panels in a lineup. * "allon_multi" turns on all LEDs of all panels in a lineup.

View File

@ -10,11 +10,6 @@ else
S = function(s) return s end S = function(s) return s end
end end
local marquee_cbox = {
type = "fixed",
fixed = { -16/32, -8/16, -16/32, 16/32, 8/16, -15/32 }
}
-- the following functions based on the so-named ones in Jeija's digilines mod -- the following functions based on the so-named ones in Jeija's digilines mod
local reset_meta = function(pos) local reset_meta = function(pos)
@ -34,17 +29,26 @@ end
-- the nodes: -- the nodes:
local fdir_to_right = { local fdir_to_right = {
{ 1, 0 },
{ 0, -1 }, { 0, -1 },
{ -1, 0 }, { 0, -1 },
{ 0, -1 },
{ 0, 1 }, { 0, 1 },
{ 1, 0 },
{ -1, 0 },
}
local cbox = {
type = "wallmounted",
wall_top = { -8/16, 7/16, -8/16, 8/16, 8/16, 8/16 },
wall_bottom = { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 },
wall_side = { -8/16, -8/16, -8/16, -7/16, 8/16, 8/16 }
} }
local padding = " " local padding = " "
local allon = string.char(128) local allon = string.char(128)
for i = 1, 64 do for i = 1, 64 do
padding = padding.." " padding = padding.." "
allon = allon..string.char(128) allon = allon..string.char(144)
end end
local display_string = function(pos, channel, string) local display_string = function(pos, channel, string)
@ -58,7 +62,7 @@ local display_string = function(pos, channel, string)
local pos2 = pos local pos2 = pos
local mastermeta = minetest.get_meta(pos) local mastermeta = minetest.get_meta(pos)
local lastcolor = mastermeta:get_int("lastcolor") local lastcolor = mastermeta:get_int("lastcolor")
if not lastcolor or lastcolor < 0 or lastcolor > 7 then if not lastcolor or lastcolor < 0 or lastcolor > 30 then
lastcolor = 0 lastcolor = 0
mastermeta:set_int("lastcolor", 0) mastermeta:set_int("lastcolor", 0)
end end
@ -66,10 +70,9 @@ local display_string = function(pos, channel, string)
local node = minetest.get_node(pos2) local node = minetest.get_node(pos2)
local meta = minetest.get_meta(pos2) local meta = minetest.get_meta(pos2)
local setchan = meta:get_string("channel") local setchan = meta:get_string("channel")
if not string.match(node.name, "led_marquee:char_") or (setchan ~= nil and setchan ~= "" and setchan ~= channel) then break end if not string.match(node.name, "led_marquee:char_") or (setchan ~= nil and setchan ~= "" and setchan ~= channel) then break end
local asc = string.byte(padded_string, i, i) local asc = string.byte(padded_string, i, i)
if (node.param2 % 8) == fdir and asc > 31 and asc < 130 then if (node.param2 % 8) == fdir and asc > 30 and asc < 256 then
minetest.swap_node(pos2, { name = "led_marquee:char_"..asc, param2 = (node.param2 % 8) + (lastcolor*8)}) minetest.swap_node(pos2, { name = "led_marquee:char_"..asc, param2 = (node.param2 % 8) + (lastcolor*8)})
pos2.x = pos2.x + fdir_to_right[fdir+1][1] pos2.x = pos2.x + fdir_to_right[fdir+1][1]
pos2.z = pos2.z + fdir_to_right[fdir+1][2] pos2.z = pos2.z + fdir_to_right[fdir+1][2]
@ -84,7 +87,7 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel") local setchan = meta:get_string("channel")
local lastcolor = meta:get_int("lastcolor") local lastcolor = meta:get_int("lastcolor")
if not lastcolor or lastcolor < 0 or lastcolor > 7 then if not lastcolor or lastcolor < 0 or lastcolor > 30 then
lastcolor = 0 lastcolor = 0
meta:set_int("lastcolor", 0) meta:set_int("lastcolor", 0)
end end
@ -101,15 +104,15 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
elseif msg == "del" then elseif msg == "del" then
minetest.swap_node(pos, { name = "led_marquee:char_127", param2 = (node.param2 % 8) + (lastcolor*8)}) minetest.swap_node(pos, { name = "led_marquee:char_127", param2 = (node.param2 % 8) + (lastcolor*8)})
elseif msg == "allon" then elseif msg == "allon" then
minetest.swap_node(pos, { name = "led_marquee:char_128", param2 = (node.param2 % 8) + (lastcolor*8)}) minetest.swap_node(pos, { name = "led_marquee:char_144", param2 = (node.param2 % 8) + (lastcolor*8)})
elseif msg == "cursor" then elseif msg == "cursor" then
minetest.swap_node(pos, { name = "led_marquee:char_129", param2 = (node.param2 % 8) + (lastcolor*8)}) minetest.swap_node(pos, { name = "led_marquee:char_31", param2 = (node.param2 % 8) + (lastcolor*8)})
else else
display_string(pos, channel, msg) display_string(pos, channel, msg)
end end
else else
local asc = string.byte(msg) local asc = string.byte(msg)
if asc > 31 and asc < 130 then if asc > 30 and asc < 256 then
minetest.swap_node(pos, { name = "led_marquee:char_"..asc, param2 = (node.param2 % 8) + (lastcolor*8)}) minetest.swap_node(pos, { name = "led_marquee:char_"..asc, param2 = (node.param2 % 8) + (lastcolor*8)})
elseif asc < 31 then elseif asc < 31 then
lastcolor = asc lastcolor = asc
@ -123,13 +126,13 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
elseif msg and type(msg) == "number" then elseif msg and type(msg) == "number" then
if msg == 0 then if msg == 0 then
minetest.swap_node(pos, { name = "led_marquee:char_32", param2 = (node.param2 % 8) + (lastcolor*8)}) minetest.swap_node(pos, { name = "led_marquee:char_32", param2 = (node.param2 % 8) + (lastcolor*8)})
elseif msg > 31 and alnum_chars[msg - 31] ~= nil then elseif msg > 30 then
minetest.swap_node(pos, { name = "led_marquee:char_"..tostring(msg), param2 = (node.param2 % 8) + (lastcolor*8)}) minetest.swap_node(pos, { name = "led_marquee:char_"..tostring(msg), param2 = (node.param2 % 8) + (lastcolor*8)})
end end
end end
end end
for i = 32, 129 do for i = 31, 255 do
local groups = { cracky = 2, not_in_creative_inventory = 1} local groups = { cracky = 2, not_in_creative_inventory = 1}
local light = LIGHT_MAX-2 local light = LIGHT_MAX-2
local description = S("Alphanumeric LED marquee panel ("..i..")") local description = S("Alphanumeric LED marquee panel ("..i..")")
@ -139,23 +142,23 @@ for i = 32, 129 do
"led_marquee_char_"..i..".png", "led_marquee_char_"..i..".png",
} }
if i == 32 then if i == 31 then
groups = {cracky = 2}
light = nil
description = S("Alphanumeric LED marquee panel")
end
if i == 129 then
tiles = { tiles = {
{ name="led_marquee_base.png", color="white"}, { name="led_marquee_base.png", color="white"},
{ name="led_marquee_leds_off.png", color="white"}, { name="led_marquee_leds_off.png", color="white"},
{ {
name = "led_marquee_char_129.png", name = "led_marquee_char_31.png",
animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.75} animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.75}
} }
} }
end end
if i == 32 then
groups = {cracky = 2}
light = nil
description = S("Alphanumeric LED marquee panel")
end
minetest.register_node("led_marquee:char_"..i, { minetest.register_node("led_marquee:char_"..i, {
description = description, description = description,
drawtype = "mesh", drawtype = "mesh",
@ -167,8 +170,8 @@ for i = 32, 129 do
paramtype = "light", paramtype = "light",
paramtype2 = "colorwallmounted", paramtype2 = "colorwallmounted",
light_source = light, light_source = light,
selection_box = marquee_cbox, selection_box = cbox,
collision_box = marquee_cbox, node_box = cbox,
on_construct = function(pos) on_construct = function(pos)
reset_meta(pos) reset_meta(pos)
end, end,

View File

@ -1,30 +1,30 @@
# Blender v2.79 (sub 0) OBJ File: 'LED marquee.blend' # Blender v2.79 (sub 0) OBJ File: 'LED marquee.blend'
# www.blender.org # www.blender.org
o Cube_Cube_LEDs o Cube_Cube_LEDs
v -0.453125 -0.500000 -0.468750 v 0.500000 -0.453125 -0.468750
v -0.453125 0.500000 -0.468750 v -0.500000 -0.453125 -0.468750
v -0.453125 0.500000 0.468750 v -0.500000 -0.453125 0.468750
v -0.453125 -0.500000 0.468750 v 0.500000 -0.453125 0.468750
v -0.437500 -0.500000 -0.500000 v 0.500000 -0.437500 -0.500000
v -0.437500 -0.500000 -0.484375 v 0.500000 -0.437500 -0.484375
v -0.453125 -0.500000 -0.468750 v 0.500000 -0.453125 -0.468750
v -0.453125 -0.500000 0.468750 v 0.500000 -0.453125 0.468750
v -0.437500 -0.500000 0.484375 v 0.500000 -0.437500 0.484375
v -0.437500 -0.500000 0.500000 v 0.500000 -0.437500 0.500000
v 0.500000 -0.500000 0.500000
v 0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 0.500000 v -0.500000 -0.500000 0.500000
v -0.500000 -0.500000 -0.500000 v -0.500000 -0.500000 -0.500000
v -0.500000 0.500000 0.500000 v -0.500000 -0.437500 0.500000
v -0.500000 0.500000 -0.500000 v -0.500000 -0.437500 0.484375
v -0.437500 0.500000 0.500000 v -0.500000 -0.453125 0.468750
v -0.437500 0.500000 0.484375 v -0.500000 -0.453125 -0.468750
v -0.453125 0.500000 0.468750 v -0.500000 -0.437500 -0.484375
v -0.453125 0.500000 -0.468750 v -0.500000 -0.437500 -0.500000
v -0.437500 0.500000 -0.484375 v 0.500000 -0.449125 -0.468750
v -0.437500 0.500000 -0.500000 v -0.500000 -0.449125 -0.468750
v -0.449125 -0.500000 -0.468750 v -0.500000 -0.449125 0.468750
v -0.449125 0.500000 -0.468750 v 0.500000 -0.449125 0.468750
v -0.449125 0.500000 0.468750
v -0.449125 -0.500000 0.468750
vt 0.667843 0.000000 vt 0.667843 0.000000
vt 0.667843 0.015513 vt 0.667843 0.015513
vt 0.681855 0.031026 vt 0.681855 0.031026
@ -73,14 +73,14 @@ vt 0.000000 0.000000
vt 1.000000 0.000000 vt 1.000000 0.000000
vt 1.000000 1.000000 vt 1.000000 1.000000
vt 0.000000 1.000000 vt 0.000000 1.000000
vn 1.0000 0.0000 -0.0000
vn 0.0000 -1.0000 0.0000 vn 0.0000 -1.0000 0.0000
vn -1.0000 -0.0000 -0.0000 vn -1.0000 0.0000 0.0000
vn -0.0000 1.0000 0.0000 vn -0.0000 -0.0000 -1.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000 vn 0.0000 0.0000 1.0000
vn 1.0000 0.0000 0.0000 vn -0.0000 1.0000 0.0000
vn 0.7071 0.0000 -0.7071 vn -0.0000 0.7071 -0.7071
vn 0.7071 0.0000 0.7071 vn -0.0000 0.7071 0.7071
g Cube_Cube_LEDs_Cube_Cube_LEDs_base g Cube_Cube_LEDs_Cube_Cube_LEDs_base
s off s off
f 5/1/1 6/2/1 7/3/1 8/4/1 9/5/1 10/6/1 11/7/1 12/8/1 f 5/1/1 6/2/1 7/3/1 8/4/1 9/5/1 10/6/1 11/7/1 12/8/1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Some files were not shown because too many files have changed in this diff Show More