diff --git a/mods/CORE/Player/src/Player.lua b/mods/CORE/Player/src/Player.lua index c415c0a..5eae71e 100644 --- a/mods/CORE/Player/src/Player.lua +++ b/mods/CORE/Player/src/Player.lua @@ -9,6 +9,11 @@ core.register_on_joinplayer(function(player) player:hud_set_hotbar_itemcount(9) local inv = player:get_inventory() inv:set_size('main', 18) + -- Player equipment slots: + inv:set_size('equip_head', 2) + inv:set_size('equip_torso', 2) + inv:set_size('equip_legs', 2) + inv:set_size('equip_feet', 2) end) core.register_chatcommand('show_inv', diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua index 9d4275d..77e16c8 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua @@ -117,7 +117,7 @@ local function getFullForm(self, playerName) -- * left tab - equipment; -- * right tab - crafting menu. ---@type PlayerInventoryUI.TabName - local leftTabName = self:getContex(playerName, 'left_tab_name') or 'craft_tab' + local leftTabName = self:getContex(playerName, 'left_tab_name') or 'equip_tab' ---@type PlayerInventoryUI.TabName local rightTabName = self:getContex(playerName, 'right_tab_name') or 'craft_tab' @@ -141,7 +141,7 @@ local function getFullForm(self, playerName) -- Removing the inventory background color: :bgcolor('#00000000', 'neither') -- A permanent part of the inventory: - :background(0, 9.5, 22, 3, 'player_inventory_middle_backgound.png', false) + :background(0, 9.5, 22, 3, 'player_inventory_middle_background.png', false) :listColors('#00000000', '#e1b69150') :list('current_player', 'main', 5.5,9.75, 9,1) :list('current_player', 'main', 5.5,11.25, 9,1, 9) diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getEquipTab.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getEquipTab.lua index aa67309..684c003 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getEquipTab.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getEquipTab.lua @@ -7,9 +7,18 @@ local Formspec = Smc.requireFormspec() local function getEquipTab(self, playerName, tabType) local EquipTab = Formspec:new() + ---The x coordinate for the equipment slot position + local equipListsX = 4.5 + EquipTab - :image(0, 0, 11, 9, 'player_inventory_tab_background.png') - :label(2,2, 'EQUIPMENT PANE') + :image(0, 0, 11, 9, 'player_inventory_equip_tab_background.png') + -- Equipment slots: + :label(equipListsX, 0.75, 'cloth') + :label(equipListsX+1.25, 0.75, 'armor') + :list('current_player', 'equip_head', equipListsX, 1, 2, 1) + :list('current_player', 'equip_torso', equipListsX, 2.25, 2, 1) + :list('current_player', 'equip_legs', equipListsX, 3.5, 2, 1) + :list('current_player', 'equip_feet', equipListsX, 4.75, 2, 1) return EquipTab end diff --git a/mods/UI/PlayerInventoryUI/textures/player_inventory_equip_tab_background.png b/mods/UI/PlayerInventoryUI/textures/player_inventory_equip_tab_background.png new file mode 100644 index 0000000..9973b6d Binary files /dev/null and b/mods/UI/PlayerInventoryUI/textures/player_inventory_equip_tab_background.png differ