summaryrefslogtreecommitdiff
path: root/roadsigns
diff options
context:
space:
mode:
authorwebdesigner97 <Christian_D_97@gmx.de>2013-10-14 19:57:41 +0200
committerwebdesigner97 <Christian_D_97@gmx.de>2013-10-14 19:57:41 +0200
commita776532a30dd80560a26d77ef9ea53848ba76ba7 (patch)
tree2b29960786c653c1d0fea3805a786868b5a00da2 /roadsigns
parent64ef3a5507eb8c729b2b749c574320f0627f2195 (diff)
downloadroads-a776532a30dd80560a26d77ef9ea53848ba76ba7.tar
roads-a776532a30dd80560a26d77ef9ea53848ba76ba7.tar.gz
roads-a776532a30dd80560a26d77ef9ea53848ba76ba7.tar.bz2
roads-a776532a30dd80560a26d77ef9ea53848ba76ba7.tar.xz
roads-a776532a30dd80560a26d77ef9ea53848ba76ba7.zip
Some more code
Diffstat (limited to 'roadsigns')
-rw-r--r--roadsigns/workshop.lua36
1 files changed, 33 insertions, 3 deletions
diff --git a/roadsigns/workshop.lua b/roadsigns/workshop.lua
index a71eeda..939c570 100644
--- a/roadsigns/workshop.lua
+++ b/roadsigns/workshop.lua
@@ -15,16 +15,46 @@ minetest.register_node(":streets:signworkshop",{
"list[context;streets:signworkshop_recipe;8,1;4,1]",
"label[9,2;Put it here:]",
"list[context;streets:signworkshop_input;8,3;4,1]",
- "list[current_player;main;2,6;8,4]"
+ "button[8,4;2,1;streets:signworkshop_send;Start!]",
+ "label[5.8,0.5;Selected:]",
+ "list[context;streets:signworkshop_select;6,1;1,1]",
+ "label[5.8,2.5;Output:]",
+ "list[context;streets:signworkshop_output;6,3;1,1]",
+ "list[current_player;main;2,6;8,4]",
}))
local inv = minetest.get_inventory({type = "node", pos = pos})
inv:set_size("streets:signworkshop_list",5*4)
inv:set_size("streets:signworkshop_recipe",3*2)
inv:set_size("streets:signworkshop_input",4*1)
+ inv:set_size("streets:signworkshop_select",1*1)
+ inv:set_size("streets:signworkshop_output",1*1)
+ end,
+ allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ if listname ~= "streets:signworkshop_input" then
+ return 0
+ else
+ return 1
+ end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
- if to_list ~= "x" then
-
+ if to_list == "streets:signworkshop_input" and from_list == "streets:signworkshop_input" then
+ return 1
+ else
+ return 0
+ end
+ end,
+ allow_metadata_inventory_take = function(pos, listname, index, stack, player)
+ if listname == "streets:signworkshop_input" or listname == "streets:signworkshop_output" then
+ return 99
+ else
+ return 0
end
end,
+ on_receive_fields = function(pos, formname, fields, sender)
+ local inv = minetest.get_inventory({type = "node", pos = pos})
+ --
+ if inv:is_emtpy("streets:signworkshop_input") ~= true then
+
+ end
+ end
}) \ No newline at end of file