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).
30
init.lua
|
@ -48,7 +48,7 @@ local padding = " "
|
|||
local allon = string.char(128)
|
||||
for i = 1, 64 do
|
||||
padding = padding.." "
|
||||
allon = allon..string.char(128)
|
||||
allon = allon..string.char(144)
|
||||
end
|
||||
|
||||
local display_string = function(pos, channel, string)
|
||||
|
@ -72,7 +72,7 @@ local display_string = function(pos, channel, string)
|
|||
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
|
||||
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)})
|
||||
pos2.x = pos2.x + fdir_to_right[fdir+1][1]
|
||||
pos2.z = pos2.z + fdir_to_right[fdir+1][2]
|
||||
|
@ -104,15 +104,15 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
|
|||
elseif msg == "del" then
|
||||
minetest.swap_node(pos, { name = "led_marquee:char_127", param2 = (node.param2 % 8) + (lastcolor*8)})
|
||||
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
|
||||
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
|
||||
display_string(pos, channel, msg)
|
||||
end
|
||||
else
|
||||
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)})
|
||||
elseif asc < 31 then
|
||||
lastcolor = asc
|
||||
|
@ -126,13 +126,13 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
|
|||
elseif msg and type(msg) == "number" then
|
||||
if msg == 0 then
|
||||
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)})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for i = 32, 129 do
|
||||
for i = 31, 255 do
|
||||
local groups = { cracky = 2, not_in_creative_inventory = 1}
|
||||
local light = LIGHT_MAX-2
|
||||
local description = S("Alphanumeric LED marquee panel ("..i..")")
|
||||
|
@ -142,23 +142,23 @@ for i = 32, 129 do
|
|||
"led_marquee_char_"..i..".png",
|
||||
}
|
||||
|
||||
if i == 32 then
|
||||
groups = {cracky = 2}
|
||||
light = nil
|
||||
description = S("Alphanumeric LED marquee panel")
|
||||
end
|
||||
|
||||
if i == 129 then
|
||||
if i == 31 then
|
||||
tiles = {
|
||||
{ name="led_marquee_base.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}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
if i == 32 then
|
||||
groups = {cracky = 2}
|
||||
light = nil
|
||||
description = S("Alphanumeric LED marquee panel")
|
||||
end
|
||||
|
||||
minetest.register_node("led_marquee:char_"..i, {
|
||||
description = description,
|
||||
drawtype = "mesh",
|
||||
|
|
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 360 B After Width: | Height: | Size: 338 B |
After Width: | Height: | Size: 210 B |
After Width: | Height: | Size: 279 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 268 B |
After Width: | Height: | Size: 302 B |
After Width: | Height: | Size: 268 B |
After Width: | Height: | Size: 272 B |
After Width: | Height: | Size: 272 B |
After Width: | Height: | Size: 306 B |
After Width: | Height: | Size: 305 B |
After Width: | Height: | Size: 302 B |
After Width: | Height: | Size: 352 B |
After Width: | Height: | Size: 270 B |
After Width: | Height: | Size: 336 B |
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 314 B |
After Width: | Height: | Size: 309 B |
After Width: | Height: | Size: 323 B |
After Width: | Height: | Size: 316 B |
After Width: | Height: | Size: 359 B |
After Width: | Height: | Size: 352 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 494 B |
After Width: | Height: | Size: 518 B |
After Width: | Height: | Size: 500 B |
After Width: | Height: | Size: 96 B |
After Width: | Height: | Size: 336 B |
After Width: | Height: | Size: 367 B |
After Width: | Height: | Size: 399 B |
After Width: | Height: | Size: 369 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 266 B |
After Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 438 B |
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 293 B |
After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 461 B |
After Width: | Height: | Size: 203 B |
After Width: | Height: | Size: 280 B |
After Width: | Height: | Size: 297 B |
After Width: | Height: | Size: 319 B |
After Width: | Height: | Size: 291 B |
After Width: | Height: | Size: 250 B |
After Width: | Height: | Size: 307 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 216 B |
After Width: | Height: | Size: 227 B |
After Width: | Height: | Size: 304 B |
After Width: | Height: | Size: 345 B |
After Width: | Height: | Size: 317 B |
After Width: | Height: | Size: 465 B |
After Width: | Height: | Size: 435 B |
After Width: | Height: | Size: 478 B |
After Width: | Height: | Size: 348 B |
After Width: | Height: | Size: 408 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 426 B |
After Width: | Height: | Size: 413 B |
After Width: | Height: | Size: 394 B |
After Width: | Height: | Size: 418 B |
After Width: | Height: | Size: 404 B |
After Width: | Height: | Size: 364 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 359 B |
After Width: | Height: | Size: 328 B |
After Width: | Height: | Size: 326 B |
After Width: | Height: | Size: 321 B |
After Width: | Height: | Size: 354 B |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 352 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 348 B |
After Width: | Height: | Size: 365 B |
After Width: | Height: | Size: 349 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 322 B |
After Width: | Height: | Size: 364 B |
After Width: | Height: | Size: 341 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 359 B |
After Width: | Height: | Size: 340 B |
After Width: | Height: | Size: 376 B |
After Width: | Height: | Size: 324 B |
After Width: | Height: | Size: 355 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 372 B |
After Width: | Height: | Size: 380 B |