summaryrefslogtreecommitdiff
path: root/teleport_tube.lua
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-01-29 19:04:20 +0100
committerTim <t4im@users.noreply.github.com>2015-01-29 19:10:01 +0100
commit1e50644487cf8143690ca3af61d9e0a5f79a8e95 (patch)
tree11286b3d43bdb1b70d530a0ce90cbfb60a08a4f4 /teleport_tube.lua
parent9d45599872caece4413d277e9c6f14527c810186 (diff)
add infotexts to the teleportation tube
this should also debunk the myth of some players, that they are the only ones seeing the channel
Diffstat (limited to 'teleport_tube.lua')
-rw-r--r--teleport_tube.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/teleport_tube.lua b/teleport_tube.lua
index 1118f97..a8d9edb 100644
--- a/teleport_tube.lua
+++ b/teleport_tube.lua
@@ -153,6 +153,7 @@ pipeworks.register_tube("pipeworks:teleport_tube","Teleporting Pneumatic Tube Se
on_construct = function(pos)
local meta = minetest.get_meta(pos)
update_meta(meta, true)
+ meta:set_string("infotext", "unconfigured Teleportation Tube")
end,
on_receive_fields = function(pos,formname,fields,sender)
if not fields.channel then
@@ -206,9 +207,12 @@ pipeworks.register_tube("pipeworks:teleport_tube","Teleporting Pneumatic Tube Se
if dirty then
if channel ~= "" then
set_tube(pos, channel, can_receive)
+ local cr_description = (can_receive == 1) and "sending and receiving" or "sending"
+ meta:set_string("infotext", string.format("Teleportation Tube %s on '%s'", cr_description, channel))
else
-- remove empty channel tubes, to not have to search through them
remove_tube(pos)
+ meta:set_string("infotext", "unconfigured Teleportation Tube")
end
end
end,