mirror of
https://github.com/minetest-mods/digilines.git
synced 2024-12-25 18:20:19 +01:00
Make lcd text persist properly
This commit is contained in:
parent
b2f959328c
commit
682e1335d9
@ -45,7 +45,7 @@ local clearscreen = function(pos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local prepare_writing = function (pos)
|
local prepare_writing = function(pos)
|
||||||
lcd_info = lcds[minetest.get_node(pos).param2]
|
lcd_info = lcds[minetest.get_node(pos).param2]
|
||||||
if lcd_info == nil then return end
|
if lcd_info == nil then return end
|
||||||
local text = minetest.add_entity(
|
local text = minetest.add_entity(
|
||||||
@ -58,12 +58,15 @@ local prepare_writing = function (pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local on_digiline_receive = function(pos, node, channel, msg)
|
local on_digiline_receive = function(pos, node, channel, msg)
|
||||||
local setchan = minetest.get_meta(pos):get_string("channel")
|
local meta = minetest.get_meta(pos)
|
||||||
|
local setchan = meta:get_string("channel")
|
||||||
if setchan ~= channel then return end
|
if setchan ~= channel then return end
|
||||||
|
|
||||||
|
meta:set_string("text", msg)
|
||||||
clearscreen(pos)
|
clearscreen(pos)
|
||||||
local text = prepare_writing (pos)
|
if msg ~= "" then
|
||||||
text:set_properties({textures={generate_texture(create_lines(msg))}})
|
prepare_writing(pos)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local lcd_box = {
|
local lcd_box = {
|
||||||
|
Loading…
Reference in New Issue
Block a user