summaryrefslogtreecommitdiff
path: root/digilines
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-12-17 02:20:30 -0500
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-12-17 02:20:30 -0500
commitec25fd83415d0ecb49f41295af3dc30f14850b2f (patch)
tree59fe699656e75a52e6665b385907b86cc0b89c16 /digilines
parent856b86858ebfa4af2c352b022188f82dcff7ed92 (diff)
downloaddreambuilder_modpack-ec25fd83415d0ecb49f41295af3dc30f14850b2f.tar
dreambuilder_modpack-ec25fd83415d0ecb49f41295af3dc30f14850b2f.tar.gz
dreambuilder_modpack-ec25fd83415d0ecb49f41295af3dc30f14850b2f.tar.bz2
dreambuilder_modpack-ec25fd83415d0ecb49f41295af3dc30f14850b2f.tar.xz
dreambuilder_modpack-ec25fd83415d0ecb49f41295af3dc30f14850b2f.zip
update biome_lib, digilines, hotbar, mesecons, pipeworks,
ropes, technic, unified inventory, unified dyes, vines, and worldedit
Diffstat (limited to 'digilines')
-rw-r--r--digilines/lcd.lua32
1 files changed, 24 insertions, 8 deletions
diff --git a/digilines/lcd.lua b/digilines/lcd.lua
index 19aa4a4..a59b0b2 100644
--- a/digilines/lcd.lua
+++ b/digilines/lcd.lua
@@ -155,24 +155,34 @@ local get_entity = function(pos)
return lcd_entity
end
-local spawn_entity = function(pos)
- if not get_entity(pos) then
- local lcd_info = lcds[minetest.get_node(pos).param2]
- if not lcd_info then
- return
- end
- local text = minetest.add_entity(vector.add(pos, lcd_info.delta), "digilines_lcd:text")
- text:set_yaw(lcd_info.yaw or 0)
+local rotate_text = function(pos, param)
+ local entity = get_entity(pos)
+ if not entity then
+ return
+ end
+ local lcd_info = lcds[param or minetest.get_node(pos).param2]
+ if not lcd_info then
+ return
end
+ entity.object:set_pos(vector.add(pos, lcd_info.delta))
+ entity.object:set_yaw(lcd_info.yaw or 0)
end
local prepare_writing = function(pos)
local entity = get_entity(pos)
if entity then
set_texture(entity)
+ rotate_text(pos)
end
end
+local spawn_entity = function(pos)
+ if not get_entity(pos) then
+ local text = minetest.add_entity(pos, "digilines_lcd:text")
+ rotate_text(pos)
+ end
+end
+
local on_digiline_receive = function(pos, _, channel, msg)
local meta = minetest.get_meta(pos)
local setchan = meta:get_string("channel")
@@ -220,6 +230,12 @@ minetest.register_node("digilines:lcd", {
spawn_entity(pos)
end
end,
+ on_rotate = function(pos, node, user, mode, new_param2)
+ if mode ~= screwdriver.ROTATE_FACE then
+ return false
+ end
+ rotate_text(pos, new_param2)
+ end,
on_receive_fields = function(pos, _, fields, sender)
local name = sender:get_player_name()
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then