28 lines
831 B
Lua
Raw Normal View History

2020-07-07 14:16:44 +02:00
function get_itemslot_bg(x, y, w, h)
local out = ""
for i = 0, w - 1, 1 do
for j = 0, h - 1, 1 do
out = out .."image["..x+i..","..y+j..";1,1;mcl_formspec_itemslot.png]"
end
end
return out
end
2020-07-18 13:20:08 +02:00
local formspec = "size[9,8.75]"..
2020-10-04 10:50:07 +02:00
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", "Hand")).."]"..
"list[current_player;hand;0,0.5;1,1;]"..
get_itemslot_bg(0,0.5,1,1)..
2020-07-07 14:16:44 +02:00
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", "Inventory")).."]"..
"list[current_player;main;0,4.5;9,3;9]"..
get_itemslot_bg(0,4.5,9,3)..
"list[current_player;main;0,7.74;9,1;]"..
get_itemslot_bg(0,7.74,9,1)..
2020-10-04 10:50:07 +02:00
"listring[current_player;hand]"..
2020-07-07 14:16:44 +02:00
"listring[current_player;main]"
2020-10-04 10:50:07 +02:00
local function hand()
minetest.show_formspec("inventory:hand", formspec)
2020-07-18 13:20:08 +02:00
end
2020-08-14 19:12:14 +02:00
2020-10-04 10:50:07 +02:00
minetest.register_cheat("Hand", "Player", hand)