2015-06-29 20:55:56 +03:00
|
|
|
inven = {}
|
2015-07-01 08:17:09 +03:00
|
|
|
CREATIVE_FORMSPEC = "";
|
|
|
|
SURVIVAL_FORMSPEC = "";
|
2015-06-29 20:55:56 +03:00
|
|
|
|
|
|
|
function inventory.creative_inv(player)
|
|
|
|
local name = player:get_player_name()
|
2017-01-05 07:12:50 +02:00
|
|
|
CREATIVE_FORMSPEC =
|
2017-01-05 16:59:37 +02:00
|
|
|
"size[11,9.75]"..
|
2017-01-05 07:12:50 +02:00
|
|
|
default.inventory_header..
|
2017-01-05 21:22:22 +02:00
|
|
|
--"background[-0.25,1;10.5,8;mcl_inventory_creative_inventory_bg.png]"..
|
2015-07-01 08:17:09 +03:00
|
|
|
"button[9.5,0;1.5,1.5;creative_search;Search]"..
|
|
|
|
"list[detached:"..name.."_armor;armor_head;0.25,1.25;1,1;]"..
|
|
|
|
"list[detached:"..name.."_armor;armor_torso;0.25,2.5;1,1;]"..
|
|
|
|
"list[detached:"..name.."_armor;armor_legs;2.75,1.25;1,1;]"..
|
|
|
|
"list[detached:"..name.."_armor;armor_feet;2.75,2.5;1,1;]"..
|
|
|
|
"image[1.3,1;1.5,3;player.png]"..
|
|
|
|
"list[current_player;main;0,4;9,4;9]"..
|
|
|
|
"list[current_player;main;0,7.75;9,1;]"..
|
|
|
|
"list[detached:creative_trash;main;9.1,7.75;1,1;]"..
|
|
|
|
"button[9.15,6;1,1;clear_inventory;Clear]"..
|
|
|
|
"button[9.5,8.75;1.5,1.5;creative_survival;Survival]"
|
2017-01-05 06:52:17 +02:00
|
|
|
|
2015-07-01 08:17:09 +03:00
|
|
|
player:get_inventory():set_width("main", 9)
|
|
|
|
player:get_inventory():set_size("main", 36)
|
2015-06-29 20:55:56 +03:00
|
|
|
player:set_inventory_formspec(CREATIVE_FORMSPEC)
|
|
|
|
end
|
|
|
|
|
|
|
|
function inventory.survival_inv(player)
|
|
|
|
local name = player:get_player_name()
|
2017-01-05 07:12:50 +02:00
|
|
|
SURVIVAL_FORMSPEC =
|
2017-01-05 16:59:37 +02:00
|
|
|
"size[9,9.5]"..
|
2017-01-05 07:12:50 +02:00
|
|
|
default.inventory_header..
|
2017-01-05 21:22:22 +02:00
|
|
|
--"background[-0.4,-0.45;9.8,9.825;mcl_inventory_survival_inventory_bg.png]"..
|
2015-06-29 20:55:56 +03:00
|
|
|
"list[detached:"..name.."_armor;armor_head;0,0;1,1;]"..
|
|
|
|
"list[detached:"..name.."_armor;armor_torso;0,1;1,1;]"..
|
|
|
|
"list[detached:"..name.."_armor;armor_legs;0,2;1,1;]"..
|
|
|
|
"list[detached:"..name.."_armor;armor_feet;0,3;1,1;]"..
|
|
|
|
"image[1.6,0.25;2,4;player.png]"..
|
|
|
|
"list[current_player;main;0,4.5;9,4;9]"..
|
|
|
|
"list[current_player;main;0,8.25;9,1;]"..
|
|
|
|
"list[current_player;craft;4,1;2,2;]"..
|
2017-01-05 06:52:17 +02:00
|
|
|
"list[current_player;craftpreview;7,1.5;1,1;]"..
|
|
|
|
"listring[current_player;main]"..
|
|
|
|
"listring[current_player;craft]"..
|
|
|
|
"listring[current_player;main]"..
|
|
|
|
"listring[detached:"..name.."_armor;armor_head]"..
|
|
|
|
"listring[current_player;main]"..
|
|
|
|
"listring[detached:"..name.."_armor;armor_torso]"..
|
|
|
|
"listring[current_player;main]"..
|
|
|
|
"listring[detached:"..name.."_armor;armor_legs]"..
|
|
|
|
"listring[current_player;main]"..
|
|
|
|
"listring[detached:"..name.."_armor;armor_feet]"
|
|
|
|
|
|
|
|
player:get_inventory():set_width("craft", 2)
|
|
|
|
player:get_inventory():set_size("craft", 4)
|
|
|
|
player:get_inventory():set_width("main", 9)
|
|
|
|
player:get_inventory():set_size("main", 36)
|
2015-06-29 20:55:56 +03:00
|
|
|
player:set_inventory_formspec(SURVIVAL_FORMSPEC)
|
|
|
|
end
|
|
|
|
|
2017-01-05 07:12:50 +02:00
|
|
|
CRAFTING_FORMSPEC =
|
|
|
|
"size[9,8.5]"..
|
|
|
|
default.inventory_header..
|
2017-01-05 21:22:22 +02:00
|
|
|
"background[-0.4,-0.5;9.78,9.5;mcl_inventory_crafting_inventory_bg.png]"..
|
2015-06-29 20:55:56 +03:00
|
|
|
"list[current_player;main;0,4.32;9,4;9]"..
|
|
|
|
"list[current_player;main;0,7.6;9,1;]"..
|
|
|
|
"list[current_player;craft;1.218,0.46;3,3;]"..
|
2017-01-05 06:52:17 +02:00
|
|
|
"list[current_player;craftpreview;6.44,1.5;1.5,1.5;]"..
|
|
|
|
"listring[current_player;main]"..
|
|
|
|
"listring[current_player;craft]"
|
2015-06-29 20:55:56 +03:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Hotbar
|
|
|
|
--
|
|
|
|
|
|
|
|
function inventory.hotbar(player)
|
|
|
|
local name = player:get_player_name()
|
|
|
|
if player.hud_set_hotbar_itemcount then
|
|
|
|
minetest.after(0, player.hud_set_hotbar_itemcount, player, 9)
|
|
|
|
end
|
2017-01-05 21:22:22 +02:00
|
|
|
player:hud_set_hotbar_image("mcl_inventory_hotbar.png")
|
|
|
|
player:hud_set_hotbar_selected_image("mcl_inventory_hotbar_selected.png")
|
2015-06-29 20:55:56 +03:00
|
|
|
end
|