summaryrefslogtreecommitdiff
path: root/roadsigns/workshop.lua
diff options
context:
space:
mode:
Diffstat (limited to 'roadsigns/workshop.lua')
-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