cwInventory panelclient
Panel defined in core/derma/cl_inventory.lua
Summary
Methods
cw.inventory.panel and builds it.Methods
Returns the width the menu should give the inventory tab.
Returns
- Number Half of the screen width
Asks the server to unequip an item, letting the item pick extra arguments first.
When the item has an OnHandleUnequip method, it is called with a function that sends the request,
optionally with arguments; otherwise the request is sent at once with the UnequipItem Cable message.
Parameters
- itemTable Item The equipped item to unequip
Creates the inventory menu tab with Inventory and Equipment sheets, registers itself as
cw.inventory.panel and builds it.
Rebuilds the sheets when the menu is opened while this tab is active.
Rebuilds the sheets when the tab is selected in the menu.
Draws nothing.
Parameters
- w
- h
Sizes the tab to 75% of the screen height and stretches the sheets to fill it.
Parameters
- w
- h
Rebuilds both sheets from the local player's inventory and equipped weapons.
The Inventory sheet starts with the weight bar, and the space bar when the space system is used.
Equipped items go to the Equipment sheet, under their equippedCategory when they have one, and
unequip when clicked. Categories are sorted by name and items by ID. Runs the PlayerInventoryRebuilt
hook with the panel and the inventory and equipment category lists before adding them.
Rebuilds the inventory when the player gets a weapon that belongs to an item.