PlayerInventory & PlayerInventoryUI: create equip slots & draft equip tab. #34

This commit is contained in:
Van
2026-04-16 21:07:19 +03:00
parent 0a97ef3a83
commit 6dba6f8c78
4 changed files with 18 additions and 4 deletions

View File

@@ -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)

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB