Summary

Methods

Init()client
Builds the storage window with a container list and, unless the storage is one-sided, the player's inventory list next to it.
Removes the window's background blur along with it.
Lays out the frame with the container list on the left half and the inventory list on the right.
Rebuilds the window on the next frame.
Rebuild()client
Rebuilds the container side from cw.storage and, unless the storage is one-sided, the player's inventory side.
Rebuilds one side of the storage window: a model preview, the weight and space bars, a cash transfer form and the items that can be moved, grouped by category.
Think()client
Keeps the window centred and rebuilds it when a rebuild is queued or the player's cash changes.

Methods

Builds the storage window with a container list and, unless the storage is one-sided, the player's inventory list next to it.

Closing the window runs the StorageClose command.

Removes the window's background blur along with it.

Lays out the frame with the container list on the left half and the inventory list on the right.

Parameters

  • w
  • h

Rebuilds the window on the next frame.

The server sends an update for the cash, the limits and each item type when a storage is opened, so queueing them rebuilds the window once instead of once per message.

Rebuilds the container side from cw.storage and, unless the storage is one-sided, the player's inventory side.

PANEL:RebuildPanel(storagePanel, storageType, usedWeight, weight, usedSpace, space, cash, inventory)

client gamemodes/catwork/gamemode/core/derma/cl_storage.lua:66

Rebuilds one side of the storage window: a model preview, the weight and space bars, a cash transfer form and the items that can be moved, grouped by category.

Only items the storage lets the player take (container side) or give (inventory side) are listed, each as a cwStorageItem. The cash form appears when cash is enabled and the side holds cash; it runs the StorageTakeCash or StorageGiveCash command. Runs the PlayerPreRebuildStorage hook with the panel before building it and PlayerStorageRebuilt with the panel and the category list after sorting the items.

Parameters

  • storagePanel Panel The cwPanelList to fill
  • storageType String 'Container' or 'Inventory'
  • usedWeight Number Weight already used, stored on the panel; when nil, the weight of the cash and listed items is stored instead
  • weight Number Maximum weight of the side
  • usedSpace Number Space already used, stored on the panel; when nil, the space of the cash and listed items is stored instead
  • space Number Maximum space of the side
  • cash Number Cash held by the side
  • inventory Inventory Items held by the side

Keeps the window centred and rebuilds it when a rebuild is queued or the player's cash changes.

Defined in