allow shift-clicking stacks

at least for Mk1 for now.
Others require more effort to create workaround
using one inventory for all slots.
This commit is contained in:
SwissalpS 2020-10-19 00:36:39 +02:00
parent df93f5d335
commit 2551bd977a
1 changed files with 4 additions and 2 deletions

View File

@ -146,14 +146,15 @@ local function make_constructor(mark, length)
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local formspec = "size[8,9;]"..
"label[0,0;"..S("Constructor Mk%d"):format(mark).."]"..
"list[current_player;main;0,5;8,4;]"
"label[0,0;"..S("Constructor Mk%d"):format(mark).."]"
for i = 1, length do
formspec = formspec
.."label[5,"..(i - 1)..";"..S("Slot %d"):format(i).."]"
.."list[current_name;slot"..i
..";6,"..(i - 1)..";1,1;]"
end
formspec = formspec .. "list[current_player;main;0,5;8,4;]"
if 1 == mark then formspec = formspec .. "listring[]" end
meta:set_string("formspec", formspec)
meta:set_string("infotext", S("Constructor Mk%d"):format(mark))
local inv = meta:get_inventory()
@ -205,3 +206,4 @@ end
make_constructor(1, 1)
make_constructor(2, 2)
make_constructor(3, 4)