summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCiaran Gultnieks <ciaran@ciarang.com>2014-02-26 13:17:01 +0000
committerCiaran Gultnieks <ciaran@ciarang.com>2014-02-26 13:22:34 +0000
commit682e1335d91aff476e8cab81a61e4d2e4f649c34 (patch)
tree1ace801dad0dcd44c16c1037710db77489c1929f
parentb2f959328c685d42e2ea3b0ec1aa8d37797d009d (diff)
Make lcd text persist properly
-rw-r--r--digilines_lcd/init.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/digilines_lcd/init.lua b/digilines_lcd/init.lua
index 57c1cda..2eefdb3 100644
--- a/digilines_lcd/init.lua
+++ b/digilines_lcd/init.lua
@@ -45,7 +45,7 @@ local clearscreen = function(pos)
end
end
-local prepare_writing = function (pos)
+local prepare_writing = function(pos)
lcd_info = lcds[minetest.get_node(pos).param2]
if lcd_info == nil then return end
local text = minetest.add_entity(
@@ -58,12 +58,15 @@ local prepare_writing = function (pos)
end
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
+ meta:set_string("text", msg)
clearscreen(pos)
- local text = prepare_writing (pos)
- text:set_properties({textures={generate_texture(create_lines(msg))}})
+ if msg ~= "" then
+ prepare_writing(pos)
+ end
end
local lcd_box = {