Add buttons for craft guide, skins, and armor on main inventory formspec

pull/14/head
Brandon 2015-07-25 15:06:21 -05:00
parent bb3551513c
commit 701ba8fed6
2 changed files with 9 additions and 1 deletions

View File

@ -41,7 +41,9 @@ end
--Parameters:
-- name: name of player who will be shown the menu
modmenu.show_menu = function(name)
minetest.show_formspec(name, "modmenu", modmenu.get_formspec(name))
local player = minetest.get_player_by_name(name)
minetest.show_formspec(name, "modmenu", player:get_inventory_formspec(name))
--minetest.show_formspec(name, "modmenu", modmenu.get_formspec(name))
end
--Register the /m command to show the menu

View File

@ -49,6 +49,12 @@ local function inventory_set_formspec(player, size)
for i = 0, msize_x - 1, 1 do
formspec = formspec.."image["..(fsize_x-msize_x + i)..","..(fsize_y-msize_y)..";1,1;gui_hb_bg.png]"
end
-- add the shortcut buttons
formspec = formspec .. "image_button[0.25,0.25;1,1;inventory_plus_zcg.png;zcg;]"
formspec = formspec .. "image_button[1.25,0.25;1,1;inventory_plus_skins.png;skins;]"
formspec = formspec .. "image_button[2.25,0.25;1,1;inventory_plus_armor.png;armor;]"
player:set_inventory_formspec(formspec)
end