From e296b919360001948711e9703a16aefeb4da2d09 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 9 Mar 2017 17:49:02 +0100 Subject: [PATCH] Add armor slot images to armor slots in creative --- mods/HUD/mcl_inventory/creative.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index cc57927414..8dec62f446 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -209,6 +209,23 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, show, p local inv_bg = "crafting_inventory_creative.png" if name == "inv" then inv_bg = "crafting_inventory_creative_survival.png" + + -- Background images for armor slots (hide if occupied) + local armor_slot_imgs = "" + local inv = player:get_inventory() + if inv:get_stack("armor", 2):is_empty() then + armor_slot_imgs = armor_slot_imgs .. "image[2.5,1.3;1,1;crafting_slot_head.png]" + end + if inv:get_stack("armor", 3):is_empty() then + armor_slot_imgs = armor_slot_imgs .. "image[2.5,2.75;1,1;crafting_slot_torso.png]" + end + if inv:get_stack("armor", 4):is_empty() then + armor_slot_imgs = armor_slot_imgs .. "image[5.5,1.3;1,1;crafting_slot_legs.png]" + end + if inv:get_stack("armor", 5):is_empty() then + armor_slot_imgs = armor_slot_imgs .. "image[5.5,2.75;1,1;crafting_slot_feet.png]" + end + -- Survival inventory slots main_list = "list[current_player;main;0,3.75;9,3;9]".. -- armor @@ -216,7 +233,7 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, show, p "list[detached:"..playername.."_armor;armor;2.5,2.75;1,1;2]".. "list[detached:"..playername.."_armor;armor;5.5,1.3;1,1;3]".. "list[detached:"..playername.."_armor;armor;5.5,2.75;1,1;4]".. - --TODO: armor_slot_imgs.. + armor_slot_imgs.. -- crafting guide button "image_button[9,1;1,1;craftguide_book.png;__mcl_craftguide;]".. "tooltip[__mcl_craftguide;Show crafting recipes]"..