From 0f4f603e2e8c9aa3f8e736ff6c6cf78bb6f3f493 Mon Sep 17 00:00:00 2001 From: cheapie Date: Thu, 16 May 2019 23:59:24 -0500 Subject: Add initial content --- COPYING | 24 + depends.txt | 1 + init.lua | 1263 ++++++++++++++++++++ textures/elevatorparts_callbutton_bg.png | Bin 0 -> 5937 bytes textures/elevatorparts_callbutton_down.png | Bin 0 -> 7578 bytes .../elevatorparts_callbutton_down_centered.png | Bin 0 -> 315 bytes textures/elevatorparts_callbutton_light.png | Bin 0 -> 222 bytes textures/elevatorparts_callbutton_up.png | Bin 0 -> 7578 bytes textures/elevatorparts_generic_bg.png | Bin 0 -> 3100 bytes textures/elevatorparts_lantern_down_off.png | Bin 0 -> 230 bytes textures/elevatorparts_lantern_down_on.png | Bin 0 -> 230 bytes textures/elevatorparts_lantern_up_off.png | Bin 0 -> 225 bytes textures/elevatorparts_lantern_up_on.png | Bin 0 -> 225 bytes textures/elevatorparts_pi_0.png | Bin 0 -> 242 bytes textures/elevatorparts_pi_1.png | Bin 0 -> 198 bytes textures/elevatorparts_pi_2.png | Bin 0 -> 238 bytes textures/elevatorparts_pi_3.png | Bin 0 -> 213 bytes textures/elevatorparts_pi_4.png | Bin 0 -> 237 bytes textures/elevatorparts_pi_5.png | Bin 0 -> 240 bytes textures/elevatorparts_pi_6.png | Bin 0 -> 237 bytes textures/elevatorparts_pi_7.png | Bin 0 -> 220 bytes textures/elevatorparts_pi_8.png | Bin 0 -> 222 bytes textures/elevatorparts_pi_9.png | Bin 0 -> 234 bytes textures/elevatorparts_pi_a.png | Bin 0 -> 235 bytes textures/elevatorparts_pi_arrow_down.png | Bin 0 -> 236 bytes textures/elevatorparts_pi_arrow_up.png | Bin 0 -> 240 bytes textures/elevatorparts_pi_b.png | Bin 0 -> 241 bytes textures/elevatorparts_pi_c.png | Bin 0 -> 241 bytes textures/elevatorparts_pi_d.png | Bin 0 -> 236 bytes textures/elevatorparts_pi_dash.png | Bin 0 -> 205 bytes textures/elevatorparts_pi_e.png | Bin 0 -> 222 bytes textures/elevatorparts_pi_f.png | Bin 0 -> 228 bytes textures/elevatorparts_pi_h.png | Bin 0 -> 245 bytes textures/elevatorparts_pi_j.png | Bin 0 -> 224 bytes textures/elevatorparts_pi_l.png | Bin 0 -> 220 bytes textures/elevatorparts_pi_n.png | Bin 0 -> 236 bytes textures/elevatorparts_pi_p.png | Bin 0 -> 240 bytes textures/elevatorparts_pi_r.png | Bin 0 -> 224 bytes textures/elevatorparts_pi_t.png | Bin 0 -> 235 bytes textures/elevatorparts_pi_u.png | Bin 0 -> 227 bytes textures/elevatorparts_pi_y.png | Bin 0 -> 235 bytes textures/elevatorparts_pilantern_bg.png | Bin 0 -> 2446 bytes textures/elevatorparts_transparent.png | Bin 0 -> 165 bytes 43 files changed, 1288 insertions(+) create mode 100644 COPYING create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 textures/elevatorparts_callbutton_bg.png create mode 100644 textures/elevatorparts_callbutton_down.png create mode 100644 textures/elevatorparts_callbutton_down_centered.png create mode 100644 textures/elevatorparts_callbutton_light.png create mode 100644 textures/elevatorparts_callbutton_up.png create mode 100644 textures/elevatorparts_generic_bg.png create mode 100644 textures/elevatorparts_lantern_down_off.png create mode 100644 textures/elevatorparts_lantern_down_on.png create mode 100644 textures/elevatorparts_lantern_up_off.png create mode 100644 textures/elevatorparts_lantern_up_on.png create mode 100644 textures/elevatorparts_pi_0.png create mode 100644 textures/elevatorparts_pi_1.png create mode 100644 textures/elevatorparts_pi_2.png create mode 100644 textures/elevatorparts_pi_3.png create mode 100644 textures/elevatorparts_pi_4.png create mode 100644 textures/elevatorparts_pi_5.png create mode 100644 textures/elevatorparts_pi_6.png create mode 100644 textures/elevatorparts_pi_7.png create mode 100644 textures/elevatorparts_pi_8.png create mode 100644 textures/elevatorparts_pi_9.png create mode 100644 textures/elevatorparts_pi_a.png create mode 100644 textures/elevatorparts_pi_arrow_down.png create mode 100644 textures/elevatorparts_pi_arrow_up.png create mode 100644 textures/elevatorparts_pi_b.png create mode 100644 textures/elevatorparts_pi_c.png create mode 100644 textures/elevatorparts_pi_d.png create mode 100644 textures/elevatorparts_pi_dash.png create mode 100644 textures/elevatorparts_pi_e.png create mode 100644 textures/elevatorparts_pi_f.png create mode 100644 textures/elevatorparts_pi_h.png create mode 100644 textures/elevatorparts_pi_j.png create mode 100644 textures/elevatorparts_pi_l.png create mode 100644 textures/elevatorparts_pi_n.png create mode 100644 textures/elevatorparts_pi_p.png create mode 100644 textures/elevatorparts_pi_r.png create mode 100644 textures/elevatorparts_pi_t.png create mode 100644 textures/elevatorparts_pi_u.png create mode 100644 textures/elevatorparts_pi_y.png create mode 100644 textures/elevatorparts_pilantern_bg.png create mode 100644 textures/elevatorparts_transparent.png diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..68a49da --- /dev/null +++ b/COPYING @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..da1d119 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +digilines diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..6cd1d57 --- /dev/null +++ b/init.lua @@ -0,0 +1,1263 @@ +minetest.register_node("elevatorparts:callbutton_up",{ + description = "Up Call Button (unprogrammed)", + groups = { + dig_immediate = 2, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,35=elevatorparts_callbutton_up.png", + }, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + meta:set_string("formspec","") + local node = minetest.get_node(pos) + node.name = "elevatorparts:callbutton_up_off" + minetest.swap_node(pos,node) + end + end, +}) + +minetest.register_node("elevatorparts:callbutton_up_off",{ + description = "Up Call Button (programmed, off state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,35=elevatorparts_callbutton_up.png", + }, + drop = "elevatorparts:callbutton_up", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_punch = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"up_press") + end, + on_rightclick = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"up_press") + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_on" then + node.name = "elevatorparts:callbutton_up_on" + minetest.swap_node(pos,node) + end + end + }, + }, +}) + +minetest.register_node("elevatorparts:callbutton_up_on",{ + description = "Up Call Button (programmed, on state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,35=elevatorparts_callbutton_up.png:33,36=elevatorparts_callbutton_light.png", + }, + drop = "elevatorparts:callbutton_up", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_punch = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"up_press") + end, + on_rightclick = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"up_press") + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_off" then + node.name = "elevatorparts:callbutton_up_off" + minetest.swap_node(pos,node) + end + end + }, + }, +}) + +minetest.register_node("elevatorparts:callbutton_down",{ + description = "Down Call Button (unprogrammed)", + groups = { + dig_immediate = 2, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,35=elevatorparts_callbutton_down.png", + }, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + meta:set_string("formspec","") + local node = minetest.get_node(pos) + node.name = "elevatorparts:callbutton_down_off" + minetest.swap_node(pos,node) + end + end, +}) + +minetest.register_node("elevatorparts:callbutton_down_off",{ + description = "Down Call Button (programmed, off state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,35=elevatorparts_callbutton_down.png", + }, + drop = "elevatorparts:callbutton_down", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_punch = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"down_press") + end, + on_rightclick = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"down_press") + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "down_light_on" then + node.name = "elevatorparts:callbutton_down_on" + minetest.swap_node(pos,node) + end + end + }, + }, +}) + +minetest.register_node("elevatorparts:callbutton_down_on",{ + description = "Down Call Button (programmed, on state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,35=elevatorparts_callbutton_down.png:33,36=elevatorparts_callbutton_light.png", + }, + drop = "elevatorparts:callbutton_down", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_punch = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"down_press") + end, + on_rightclick = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"down_press") + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "down_light_off" then + node.name = "elevatorparts:callbutton_down_off" + minetest.swap_node(pos,node) + end + end + }, + }, +}) + +minetest.register_node("elevatorparts:callbutton_both",{ + description = "Up and Down Call Buttons (unprogrammed)", + groups = { + dig_immediate = 2, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,28=elevatorparts_callbutton_up.png:24,43=elevatorparts_callbutton_down.png", + }, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + meta:set_string("formspec","") + meta:set_string("infotext","Left-click for up or right-click for down") + local node = minetest.get_node(pos) + node.name = "elevatorparts:callbutton_both_off" + minetest.swap_node(pos,node) + end + end, +}) + +minetest.register_node("elevatorparts:callbutton_both_off",{ + description = "Up and Down Call Buttons (programmed, both off state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,28=elevatorparts_callbutton_up.png:24,43=elevatorparts_callbutton_down.png", + }, + drop = "elevatorparts:callbutton_both", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_punch = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"up_press") + end, + on_rightclick = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"down_press") + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_on" then + node.name = "elevatorparts:callbutton_both_upon" + minetest.swap_node(pos,node) + elseif msg == "down_light_on" then + node.name = "elevatorparts:callbutton_both_downon" + minetest.swap_node(pos,node) + end + end + }, + }, +}) + +minetest.register_node("elevatorparts:callbutton_both_upon",{ + description = "Up and Down Call Buttons (programmed, up on, down off state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,28=elevatorparts_callbutton_up.png:24,43=elevatorparts_callbutton_down.png:33,29=elevatorparts_callbutton_light.png", + }, + drop = "elevatorparts:callbutton_both", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_punch = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"up_press") + end, + on_rightclick = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"down_press") + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_off" then + node.name = "elevatorparts:callbutton_both_off" + minetest.swap_node(pos,node) + elseif msg == "down_light_on" then + node.name = "elevatorparts:callbutton_both_on" + minetest.swap_node(pos,node) + end + end + }, + }, +}) + +minetest.register_node("elevatorparts:callbutton_both_downon",{ + description = "Up and Down Call Buttons (programmed, up off, down on state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,28=elevatorparts_callbutton_up.png:24,43=elevatorparts_callbutton_down.png:33,44=elevatorparts_callbutton_light.png", + }, + drop = "elevatorparts:callbutton_both", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_punch = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"up_press") + end, + on_rightclick = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"down_press") + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_on" then + node.name = "elevatorparts:callbutton_both_on" + minetest.swap_node(pos,node) + elseif msg == "down_light_off" then + node.name = "elevatorparts:callbutton_both_off" + minetest.swap_node(pos,node) + end + end + }, + }, +}) + +minetest.register_node("elevatorparts:callbutton_both_on",{ + description = "Up and Down Call Buttons (programmed, both on state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_generic_bg.png:22,24=elevatorparts_callbutton_bg.png:24,28=elevatorparts_callbutton_up.png:24,43=elevatorparts_callbutton_down.png:33,29=elevatorparts_callbutton_light.png:33,44=elevatorparts_callbutton_light.png", + }, + drop = "elevatorparts:callbutton_both", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + {-0.16, -0.37, 0.45, 0.17, 0.13, 0.48}, + }, + }, + on_punch = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"up_press") + end, + on_rightclick = function(pos) + digiline:receptor_send(pos,digiline.rules.default,minetest.get_meta(pos):get_string("channel"),"down_press") + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_off" then + node.name = "elevatorparts:callbutton_both_downon" + minetest.swap_node(pos,node) + elseif msg == "down_light_off" then + node.name = "elevatorparts:callbutton_both_upon" + minetest.swap_node(pos,node) + end + end + }, + }, +}) + +local chars = { + ["0"] = "elevatorparts_pi_0.png", + ["1"] = "elevatorparts_pi_1.png", + ["2"] = "elevatorparts_pi_2.png", + ["3"] = "elevatorparts_pi_3.png", + ["4"] = "elevatorparts_pi_4.png", + ["5"] = "elevatorparts_pi_5.png", + ["6"] = "elevatorparts_pi_6.png", + ["7"] = "elevatorparts_pi_7.png", + ["8"] = "elevatorparts_pi_8.png", + ["9"] = "elevatorparts_pi_9.png", + ["a"] = "elevatorparts_pi_a.png", + ["b"] = "elevatorparts_pi_b.png", + ["c"] = "elevatorparts_pi_c.png", + ["d"] = "elevatorparts_pi_d.png", + ["e"] = "elevatorparts_pi_e.png", + ["f"] = "elevatorparts_pi_f.png", + ["g"] = "elevatorparts_pi_9.png", + ["h"] = "elevatorparts_pi_h.png", + ["i"] = "elevatorparts_pi_1.png", + ["j"] = "elevatorparts_pi_j.png", + ["l"] = "elevatorparts_pi_l.png", + ["n"] = "elevatorparts_pi_n.png", + ["o"] = "elevatorparts_pi_0.png", + ["p"] = "elevatorparts_pi_p.png", + ["r"] = "elevatorparts_pi_r.png", + ["s"] = "elevatorparts_pi_5.png", + ["t"] = "elevatorparts_pi_t.png", + ["u"] = "elevatorparts_pi_u.png", + ["y"] = "elevatorparts_pi_y.png", + ["z"] = "elevatorparts_pi_2.png", + ["-"] = "elevatorparts_pi_dash.png", + [" "] = "elevatorparts_transparent.png", +} + +minetest.register_entity("elevatorparts:pi_entity",{ + initial_properties = { + visual = "upright_sprite", + physical = false, + collisionbox = {0,0,0,0,0,0,}, + textures = {"elevatorparts_transparent.png",}, + }, +}) + +local function removeEntity(pos) + local entitiesNearby = minetest.get_objects_inside_radius(pos,0.5) + for _,i in pairs(entitiesNearby) do + if i:get_luaentity() and i:get_luaentity().name == "elevatorparts:pi_entity" then + i:remove() + end + end +end + +local function generateTexture(text,uparrow,downarrow) + local out = string.format("[combine:64x64:0,0=elevatorparts_transparent.png") + local pos = 0 + for i=1,string.len(text),1 do + local char = string.sub(text,i,i) + out = out..string.format(":%d,7=%s",pos*12+22,chars[char] or chars["-"]) + pos = pos+1 + end + if uparrow then out = out..":6,7=elevatorparts_pi_arrow_up.png" + elseif downarrow then out = out..":6,7=elevatorparts_pi_arrow_down.png" end + return out +end + +local function updateDisplay(pos) + removeEntity(pos) + local meta = minetest.get_meta(pos) + local text = meta:get_string("text") + local entity = minetest.add_entity(pos,"elevatorparts:pi_entity") + local nname = minetest.get_node(pos).name + local fdir = minetest.facedir_to_dir(minetest.get_node(pos).param2) + local uparrow = meta:get_int("uparrow") > 0 + local downarrow = meta:get_int("downarrow") > 0 + local etex = generateTexture(text,uparrow,downarrow) + entity:set_properties({textures={etex}}) + entity:set_yaw((fdir.x ~= 0) and math.pi/2 or 0) + entity:setpos(vector.add(pos,vector.multiply(fdir,0.45))) +end + +local pi_ignore = { + up_light_on = true, + up_light_off = true, + down_light_on = true, + down_light_off = true, + up_press = true, + down_press = true, + arrow_up = true, + arrow_down = true, + arrow_off = true, +} + +minetest.register_node("elevatorparts:pilantern_up_off",{ + description = "PI + Up Lantern Combo", + groups = { + dig_immediate = 2, + elevatorparts_pi_lbm = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_pilantern_bg.png:25,37=elevatorparts_lantern_up_off.png", + }, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_on" then + node.name = "elevatorparts:pilantern_up_on" + minetest.swap_node(pos,node) + elseif msg == "arrow_up" then + meta:set_int("uparrow",1) + meta:set_int("downarrow",0) + elseif msg == "arrow_down" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",1) + elseif msg == "arrow_off" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",0) + elseif not pi_ignore[msg] then + meta:set_string("text",string.sub(" "..msg,-3,-1)) + end + updateDisplay(pos) + end + }, + }, +}) + +minetest.register_node("elevatorparts:pilantern_up_on",{ + description = "PI + Up Lantern Combo (on state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + elevatorparts_pi_lbm = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_pilantern_bg.png:25,37=elevatorparts_lantern_up_on.png", + }, + drop = "elevatorparts:pilantern_up_off", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_off" then + node.name = "elevatorparts:pilantern_up_off" + minetest.swap_node(pos,node) + elseif msg == "arrow_up" then + meta:set_int("uparrow",1) + meta:set_int("downarrow",0) + elseif msg == "arrow_down" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",1) + elseif msg == "arrow_off" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",0) + elseif not pi_ignore[msg] then + meta:set_string("text",string.sub(" "..msg,-3,-1)) + end + updateDisplay(pos) + end + }, + }, +}) + +minetest.register_node("elevatorparts:pilantern_down_off",{ + description = "PI + Down Lantern Combo", + groups = { + dig_immediate = 2, + elevatorparts_pi_lbm = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_pilantern_bg.png:25,37=elevatorparts_lantern_down_off.png", + }, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "down_light_on" then + node.name = "elevatorparts:pilantern_down_on" + minetest.swap_node(pos,node) + elseif msg == "arrow_up" then + meta:set_int("uparrow",1) + meta:set_int("downarrow",0) + elseif msg == "arrow_down" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",1) + elseif msg == "arrow_off" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",0) + elseif not pi_ignore[msg] then + meta:set_string("text",string.sub(" "..msg,-3,-1)) + end + updateDisplay(pos) + end + }, + }, +}) + +minetest.register_node("elevatorparts:pilantern_down_on",{ + description = "PI + Down Lantern Combo (on state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + elevatorparts_pi_lbm = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_pilantern_bg.png:25,37=elevatorparts_lantern_down_on.png", + }, + drop = "elevatorparts:pilantern_down_off", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "down_light_off" then + node.name = "elevatorparts:pilantern_down_off" + minetest.swap_node(pos,node) + elseif msg == "arrow_up" then + meta:set_int("uparrow",1) + meta:set_int("downarrow",0) + elseif msg == "arrow_down" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",1) + elseif msg == "arrow_off" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",0) + elseif not pi_ignore[msg] then + meta:set_string("text",string.sub(" "..msg,-3,-1)) + end + updateDisplay(pos) + end + }, + }, +}) + +minetest.register_node("elevatorparts:pilantern_updown_off",{ + description = "PI + Up and Down Lantern Combo", + groups = { + dig_immediate = 2, + elevatorparts_pi_lbm = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_pilantern_bg.png:10,37=elevatorparts_lantern_up_off.png:39,37=elevatorparts_lantern_down_off.png", + }, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_on" then + node.name = "elevatorparts:pilantern_updown_upon" + minetest.swap_node(pos,node) + elseif msg == "down_light_on" then + node.name = "elevatorparts:pilantern_updown_downon" + minetest.swap_node(pos,node) + elseif msg == "arrow_up" then + meta:set_int("uparrow",1) + meta:set_int("downarrow",0) + elseif msg == "arrow_down" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",1) + elseif msg == "arrow_off" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",0) + elseif not pi_ignore[msg] then + meta:set_string("text",string.sub(" "..msg,-3,-1)) + end + updateDisplay(pos) + end + }, + }, +}) + +minetest.register_node("elevatorparts:pilantern_updown_upon",{ + description = "PI + Up and Down Lantern Combo (up on, down off state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + elevatorparts_pi_lbm = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_pilantern_bg.png:10,37=elevatorparts_lantern_up_on.png:39,37=elevatorparts_lantern_down_off.png", + }, + drop = "elevatorparts:pilantern_updown_off", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_off" then + node.name = "elevatorparts:pilantern_updown_off" + minetest.swap_node(pos,node) + elseif msg == "down_light_on" then + node.name = "elevatorparts:pilantern_updown_bothon" + minetest.swap_node(pos,node) + elseif msg == "arrow_up" then + meta:set_int("uparrow",1) + meta:set_int("downarrow",0) + elseif msg == "arrow_down" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",1) + elseif msg == "arrow_off" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",0) + elseif not pi_ignore[msg] then + meta:set_string("text",string.sub(" "..msg,-3,-1)) + end + updateDisplay(pos) + end + }, + }, +}) + +minetest.register_node("elevatorparts:pilantern_updown_downon",{ + description = "PI + Up and Down Lantern Combo (up off, down on state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + elevatorparts_pi_lbm = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_pilantern_bg.png:10,37=elevatorparts_lantern_up_off.png:39,37=elevatorparts_lantern_down_on.png", + }, + drop = "elevatorparts:pilantern_updown_off", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_on" then + node.name = "elevatorparts:pilantern_updown_bothon" + minetest.swap_node(pos,node) + elseif msg == "down_light_off" then + node.name = "elevatorparts:pilantern_updown_off" + minetest.swap_node(pos,node) + elseif msg == "arrow_up" then + meta:set_int("uparrow",1) + meta:set_int("downarrow",0) + elseif msg == "arrow_down" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",1) + elseif msg == "arrow_off" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",0) + elseif not pi_ignore[msg] then + meta:set_string("text",string.sub(" "..msg,-3,-1)) + end + updateDisplay(pos) + end + }, + }, +}) + +minetest.register_node("elevatorparts:pilantern_updown_bothon",{ + description = "PI + Up and Down Lantern Combo (both on state - you hacker you!)", + groups = { + dig_immediate = 2, + not_in_creative_inventory = 1, + elevatorparts_pi_lbm = 1, + }, + tiles = { + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "elevatorparts_generic_bg.png", + "[combine:64x64:0,0=elevatorparts_pilantern_bg.png:10,37=elevatorparts_lantern_up_on.png:39,37=elevatorparts_lantern_down_on.png", + }, + drop = "elevatorparts:pilantern_updown_off", + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.48, 0.5, 0.5, 0.5 }, + }, + }, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + 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 + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then + meta:set_string("channel",fields.channel) + end + end, + digiline = { + receptor = {}, + effector = { + action = function(pos,node,channel,msg) + local meta = minetest.get_meta(pos) + if meta:get_string("channel") ~= channel or type(msg) ~= "string" then return end + msg = string.lower(msg) + if msg == "up_light_off" then + node.name = "elevatorparts:pilantern_updown_downon" + minetest.swap_node(pos,node) + elseif msg == "down_light_off" then + node.name = "elevatorparts:pilantern_updown_upon" + minetest.swap_node(pos,node) + elseif msg == "arrow_up" then + meta:set_int("uparrow",1) + meta:set_int("downarrow",0) + elseif msg == "arrow_down" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",1) + elseif msg == "arrow_off" then + meta:set_int("uparrow",0) + meta:set_int("downarrow",0) + elseif not pi_ignore[msg] then + meta:set_string("text",string.sub(" "..msg,-3,-1)) + end + updateDisplay(pos) + end + }, + }, +}) + +minetest.register_lbm({ + name = "elevatorparts:pi_respawn", + label = "Respawn PI display entities", + nodenames = {"group:elevatorparts_pi_lbm"}, + run_at_every_load = true, + action = updateDisplay, +}) + +minetest.register_craft({ + output = "elevatorparts:callbutton_up", + recipe = { + {"basic_materials:plastic_sheet","mesecons_button:button_off","basic_materials:plastic_sheet"}, + {"mesecons_luacontroller:luacontroller0000","mesecons_lightstone:lightstone_blue_off","basic_materials:plastic_sheet"}, + {"basic_materials:plastic_sheet","","basic_materials:plastic_sheet"}, + }, +}) + +minetest.register_craft({ + output = "elevatorparts:callbutton_down", + recipe = { + {"basic_materials:plastic_sheet","","basic_materials:plastic_sheet"}, + {"mesecons_luacontroller:luacontroller0000","mesecons_lightstone:lightstone_blue_off","basic_materials:plastic_sheet"}, + {"basic_materials:plastic_sheet","mesecons_button:button_off","basic_materials:plastic_sheet"}, + }, +}) + +minetest.register_craft({ + output = "elevatorparts:callbutton_both", + recipe = { + {"basic_materials:plastic_sheet","mesecons_button:button_off","basic_materials:plastic_sheet"}, + {"mesecons_luacontroller:luacontroller0000","mesecons_lightstone:lightstone_blue_off","basic_materials:plastic_sheet"}, + {"basic_materials:plastic_sheet","mesecons_button:button_off","basic_materials:plastic_sheet"}, + }, +}) + +minetest.register_craft({ + output = "elevatorparts:pilantern_up_off", + recipe = { + {"basic_materials:plastic_sheet","basic_materials:plastic_sheet","basic_materials:plastic_sheet"}, + {"mesecons_luacontroller:luacontroller0000","digilines:lcd","basic_materials:plastic_sheet"}, + {"basic_materials:plastic_sheet","mesecons_lightstone:lightstone_green_off","basic_materials:plastic_sheet"}, + }, +}) + +minetest.register_craft({ + output = "elevatorparts:pilantern_down_off", + recipe = { + {"basic_materials:plastic_sheet","basic_materials:plastic_sheet","basic_materials:plastic_sheet"}, + {"mesecons_luacontroller:luacontroller0000","digilines:lcd","basic_materials:plastic_sheet"}, + {"basic_materials:plastic_sheet","mesecons_lightstone:lightstone_red_off","basic_materials:plastic_sheet"}, + }, +}) + +minetest.register_craft({ + output = "elevatorparts:pilantern_updown_off", + recipe = { + {"basic_materials:plastic_sheet","basic_materials:plastic_sheet","basic_materials:plastic_sheet"}, + {"mesecons_luacontroller:luacontroller0000","digilines:lcd","basic_materials:plastic_sheet"}, + {"mesecons_lightstone:lightstone_green_off","basic_materials:plastic_sheet","mesecons_lightstone:lightstone_red_off"}, + }, +}) diff --git a/textures/elevatorparts_callbutton_bg.png b/textures/elevatorparts_callbutton_bg.png new file mode 100644 index 0000000..018a32b Binary files /dev/null and b/textures/elevatorparts_callbutton_bg.png differ diff --git a/textures/elevatorparts_callbutton_down.png b/textures/elevatorparts_callbutton_down.png new file mode 100644 index 0000000..14bb89e Binary files /dev/null and b/textures/elevatorparts_callbutton_down.png differ diff --git a/textures/elevatorparts_callbutton_down_centered.png b/textures/elevatorparts_callbutton_down_centered.png new file mode 100644 index 0000000..a80142e Binary files /dev/null and b/textures/elevatorparts_callbutton_down_centered.png differ diff --git a/textures/elevatorparts_callbutton_light.png b/textures/elevatorparts_callbutton_light.png new file mode 100644 index 0000000..eb36837 Binary files /dev/null and b/textures/elevatorparts_callbutton_light.png differ diff --git a/textures/elevatorparts_callbutton_up.png b/textures/elevatorparts_callbutton_up.png new file mode 100644 index 0000000..29176ed Binary files /dev/null and b/textures/elevatorparts_callbutton_up.png differ diff --git a/textures/elevatorparts_generic_bg.png b/textures/elevatorparts_generic_bg.png new file mode 100644 index 0000000..6b2e7ed Binary files /dev/null and b/textures/elevatorparts_generic_bg.png differ diff --git a/textures/elevatorparts_lantern_down_off.png b/textures/elevatorparts_lantern_down_off.png new file mode 100644 index 0000000..824ab82 Binary files /dev/null and b/textures/elevatorparts_lantern_down_off.png differ diff --git a/textures/elevatorparts_lantern_down_on.png b/textures/elevatorparts_lantern_down_on.png new file mode 100644 index 0000000..fc46486 Binary files /dev/null and b/textures/elevatorparts_lantern_down_on.png differ diff --git a/textures/elevatorparts_lantern_up_off.png b/textures/elevatorparts_lantern_up_off.png new file mode 100644 index 0000000..fac7a8a Binary files /dev/null and b/textures/elevatorparts_lantern_up_off.png differ diff --git a/textures/elevatorparts_lantern_up_on.png b/textures/elevatorparts_lantern_up_on.png new file mode 100644 index 0000000..37d55a3 Binary files /dev/null and b/textures/elevatorparts_lantern_up_on.png differ diff --git a/textures/elevatorparts_pi_0.png b/textures/elevatorparts_pi_0.png new file mode 100644 index 0000000..8b77586 Binary files /dev/null and b/textures/elevatorparts_pi_0.png differ diff --git a/textures/elevatorparts_pi_1.png b/textures/elevatorparts_pi_1.png new file mode 100644 index 0000000..b56c849 Binary files /dev/null and b/textures/elevatorparts_pi_1.png differ diff --git a/textures/elevatorparts_pi_2.png b/textures/elevatorparts_pi_2.png new file mode 100644 index 0000000..2556b36 Binary files /dev/null and b/textures/elevatorparts_pi_2.png differ diff --git a/textures/elevatorparts_pi_3.png b/textures/elevatorparts_pi_3.png new file mode 100644 index 0000000..3a189f3 Binary files /dev/null and b/textures/elevatorparts_pi_3.png differ diff --git a/textures/elevatorparts_pi_4.png b/textures/elevatorparts_pi_4.png new file mode 100644 index 0000000..20b936c Binary files /dev/null and b/textures/elevatorparts_pi_4.png differ diff --git a/textures/elevatorparts_pi_5.png b/textures/elevatorparts_pi_5.png new file mode 100644 index 0000000..35bc3ca Binary files /dev/null and b/textures/elevatorparts_pi_5.png differ diff --git a/textures/elevatorparts_pi_6.png b/textures/elevatorparts_pi_6.png new file mode 100644 index 0000000..f73b024 Binary files /dev/null and b/textures/elevatorparts_pi_6.png differ diff --git a/textures/elevatorparts_pi_7.png b/textures/elevatorparts_pi_7.png new file mode 100644 index 0000000..8e792e9 Binary files /dev/null and b/textures/elevatorparts_pi_7.png differ diff --git a/textures/elevatorparts_pi_8.png b/textures/elevatorparts_pi_8.png new file mode 100644 index 0000000..e7b5f02 Binary files /dev/null and b/textures/elevatorparts_pi_8.png differ diff --git a/textures/elevatorparts_pi_9.png b/textures/elevatorparts_pi_9.png new file mode 100644 index 0000000..3e2f2c1 Binary files /dev/null and b/textures/elevatorparts_pi_9.png differ diff --git a/textures/elevatorparts_pi_a.png b/textures/elevatorparts_pi_a.png new file mode 100644 index 0000000..6ffb6d1 Binary files /dev/null and b/textures/elevatorparts_pi_a.png differ diff --git a/textures/elevatorparts_pi_arrow_down.png b/textures/elevatorparts_pi_arrow_down.png new file mode 100644 index 0000000..a704aba Binary files /dev/null and b/textures/elevatorparts_pi_arrow_down.png differ diff --git a/textures/elevatorparts_pi_arrow_up.png b/textures/elevatorparts_pi_arrow_up.png new file mode 100644 index 0000000..20ff5e0 Binary files /dev/null and b/textures/elevatorparts_pi_arrow_up.png differ diff --git a/textures/elevatorparts_pi_b.png b/textures/elevatorparts_pi_b.png new file mode 100644 index 0000000..fa24c4a Binary files /dev/null and b/textures/elevatorparts_pi_b.png differ diff --git a/textures/elevatorparts_pi_c.png b/textures/elevatorparts_pi_c.png new file mode 100644 index 0000000..6eb3258 Binary files /dev/null and b/textures/elevatorparts_pi_c.png differ diff --git a/textures/elevatorparts_pi_d.png b/textures/elevatorparts_pi_d.png new file mode 100644 index 0000000..c91e1ad Binary files /dev/null and b/textures/elevatorparts_pi_d.png differ diff --git a/textures/elevatorparts_pi_dash.png b/textures/elevatorparts_pi_dash.png new file mode 100644 index 0000000..8202f93 Binary files /dev/null and b/textures/elevatorparts_pi_dash.png differ diff --git a/textures/elevatorparts_pi_e.png b/textures/elevatorparts_pi_e.png new file mode 100644 index 0000000..1cb74a0 Binary files /dev/null and b/textures/elevatorparts_pi_e.png differ diff --git a/textures/elevatorparts_pi_f.png b/textures/elevatorparts_pi_f.png new file mode 100644 index 0000000..3cc8c8b Binary files /dev/null and b/textures/elevatorparts_pi_f.png differ diff --git a/textures/elevatorparts_pi_h.png b/textures/elevatorparts_pi_h.png new file mode 100644 index 0000000..a96f814 Binary files /dev/null and b/textures/elevatorparts_pi_h.png differ diff --git a/textures/elevatorparts_pi_j.png b/textures/elevatorparts_pi_j.png new file mode 100644 index 0000000..70a577c Binary files /dev/null and b/textures/elevatorparts_pi_j.png differ diff --git a/textures/elevatorparts_pi_l.png b/textures/elevatorparts_pi_l.png new file mode 100644 index 0000000..144e47b Binary files /dev/null and b/textures/elevatorparts_pi_l.png differ diff --git a/textures/elevatorparts_pi_n.png b/textures/elevatorparts_pi_n.png new file mode 100644 index 0000000..03b9bb8 Binary files /dev/null and b/textures/elevatorparts_pi_n.png differ diff --git a/textures/elevatorparts_pi_p.png b/textures/elevatorparts_pi_p.png new file mode 100644 index 0000000..a6e87be Binary files /dev/null and b/textures/elevatorparts_pi_p.png differ diff --git a/textures/elevatorparts_pi_r.png b/textures/elevatorparts_pi_r.png new file mode 100644 index 0000000..a92d3e7 Binary files /dev/null and b/textures/elevatorparts_pi_r.png differ diff --git a/textures/elevatorparts_pi_t.png b/textures/elevatorparts_pi_t.png new file mode 100644 index 0000000..94d504c Binary files /dev/null and b/textures/elevatorparts_pi_t.png differ diff --git a/textures/elevatorparts_pi_u.png b/textures/elevatorparts_pi_u.png new file mode 100644 index 0000000..af24dfb Binary files /dev/null and b/textures/elevatorparts_pi_u.png differ diff --git a/textures/elevatorparts_pi_y.png b/textures/elevatorparts_pi_y.png new file mode 100644 index 0000000..b7b939b Binary files /dev/null and b/textures/elevatorparts_pi_y.png differ diff --git a/textures/elevatorparts_pilantern_bg.png b/textures/elevatorparts_pilantern_bg.png new file mode 100644 index 0000000..fd3f13b Binary files /dev/null and b/textures/elevatorparts_pilantern_bg.png differ diff --git a/textures/elevatorparts_transparent.png b/textures/elevatorparts_transparent.png new file mode 100644 index 0000000..489aca7 Binary files /dev/null and b/textures/elevatorparts_transparent.png differ -- cgit v1.2.3