Summary

Methods

Returns the width the menu should give the inventory tab.
Asks the server to unequip an item, letting the item pick extra arguments first.
Init()client
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.
Sizes the tab to 75% of the screen height and stretches the sheets to fill it.
Rebuild()client
Rebuilds both sheets from the local player's inventory and equipped weapons.
Think()client
Rebuilds the inventory when the player gets a weapon that belongs to an item.

Methods

Returns the width the menu should give the inventory tab.

Returns

  • Number Half of the screen width

PANEL:HandleUnequip(itemTable)

client gamemodes/catwork/gamemode/core/derma/cl_inventory.lua:47

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.

Defined in