Compare commits

...

5 Commits

Author SHA1 Message Date
Vanessa Dannenberg 0765804d04 use UI's theme 2021-03-12 12:58:17 -05:00
cheapie 3f84af947f Add support for the new unified_inventory background
Requires unified_inventory 0616d1f76b or newer.
2021-03-06 18:48:39 -06:00
cheapie d11f870de2 Fix missing inventories 2016-11-27 22:50:04 -06:00
cheapie c79b5de686 avoid "leaking" detached inventories to other players (#1)
(see also, 2ff48b22a9 )
2016-11-27 01:06:34 -06:00
cheapie 143f97eaae Fix crash 2016-05-28 08:24:35 -05:00
1 changed files with 24 additions and 14 deletions

View File

@ -2,18 +2,28 @@ invsaw = {}
invsaw.users = {}
local fancy_inv = default.gui_bg..default.gui_bg_img..default.gui_slots
invsaw.formspec = "size[11,10]"..fancy_inv..
"label[0,0;Input\nmaterial]" ..
"list[detached:invsaw_%s;input;1.5,0;1,1;]" ..
"label[0,1;Left-over]" ..
"list[detached:invsaw_%s;micro;1.5,1;1,1;]" ..
"label[0,2;Recycle\noutput]" ..
"list[detached:invsaw_%s;recycle;1.5,2;1,1;]" ..
"field[0.3,3.5;1,1;max_offered;Max:;%s]" ..
"button[1,3.2;1,1;Set;Set]" ..
"list[detached:invsaw_%s;output;2.8,0;8,6;]" ..
"list[current_player;main;1.5,6.25;8,4;]"
local ui = unified_inventory
invsaw.formspec = "formspec_version[4]"..
"size[15,15]"..
"background9[0,0;1,1;ui_formbg_9_sliced.png;true;16]"..
"listcolors[#00000000;#FFFFFF80;#00000000]"..
ui.single_slot(1.88, 0.88, true)..
"label[0.75,1.3;Input\nmaterial]" ..
"list[detached:invsaw_%s;input;2,1;1,1;]" ..
"label[0.75,3;Left-over]" ..
ui.single_slot(1.88, 2.38)..
"list[detached:invsaw_%s;micro;2,2.5;1,1;]" ..
"label[0.75,4.3;Recycle\noutput]" ..
ui.single_slot(1.88, 3.88)..
"list[detached:invsaw_%s;recycle;2,4;1,1;]" ..
"field[0.75,6;1,1;max_offered;Max:;%s]" ..
"button[2,6;1,1;Set;Set]" ..
ui.make_inv_img_grid(3.88, 0.88, 8, 6)..
"list[detached:invsaw_%s;output;4,1;8,6;]" ..
ui.make_inv_img_grid(3.88, 9.38, 8, 1, true)..
ui.make_inv_img_grid(3.88, 10.63, 8, 3)..
"list[current_player;main;4,9.5;8,4;]"
invsaw.nosawformspec = "size[5,2]"..
"label[0,0;You don't have a circular saw in your inventory!\nYou need to have one in order to use this function.]"..
@ -136,7 +146,7 @@ invsaw.on_take = function(inv, listname, index, stack, player)
player_inv:add_item("main", input_stack)
end
circular_saw:reset(pos)
invsaw.reset(inv,player:get_player_name())
return
end
@ -190,7 +200,7 @@ minetest.register_on_joinplayer(function(player)
on_put = invsaw.on_put,
on_take = invsaw.on_take,
allow_move = function() return 0 end
})
}, name)
inv:set_size("input",1)
inv:set_size("micro",1)
inv:set_size("recycle",1)