Show / Hide Table of Contents

Namespace Content.Shared.Storage.Components

Classes

BinComponent

This is used for things like paper bins, in which you can only take off of the top of the bin.

DumpableComponent

Lets you dump this container on the ground using a verb, or when interacting with it on a disposal unit or placeable surface.

DumpableDoAfterEvent

EntityStorageComponentState

InsideEntityStorageComponent

Added to entities contained within entity storage, for directed event purposes.

ItemCounterComponent

Storage that spawns and counts a single item. Usually used for things like matchboxes, cigarette packs, cigar cases etc.

ItemMapperComponent

ItemMapperComponent is a that maps string labels to an EntityWhitelist of elements. Useful primarily for visualization.

To define a mapping, create a mapLayers map in configuration ItemMapper component and with MapLayers mapping. Each map layer maps layer name to an EntityWhitelist, plus special modifiers for min and max item count. Min and max count are useful when you need to visualize a certain number of items, for example, to display one, two, three, or more items.

If you need a more straightforward way to change appearance where only variable is how many items, rather than which items and how many, see ItemCounterComponent

For a contrived example, create a tool-belt with a Power drill slot and two light bulb slots. To use this for visualization, we need a or VisualizerSystem, e.g.

  - type: Appearance
     visuals:
     - type: MappedItemVisualizer
To map Powerdrill TagComponent to the given example, we need the following code.
- type: ItemMapper
  mapLayers:
    drill:
      whitelist:
        tags:
        - Powerdrill
#... to be continued
To map Lightbulb (not tag) to two different layers (for one and two light bulbs, respectively)
#... to be continued
    lightbulb1:
      minCount: 1
      whitelist:
        component:
        - Lightbulb
    lightbulb2:
      minCount: 2
      whitelist:
        component:
        - Lightbulb
The min count will ensure that lightbulb1 layer is only displayed when one or more light bulbs are in the belt. And lightbulb2 layer will only be shown when two or more light bulbs are inserted.

EntityWhitelist SharedMapLayerData

SharedEntityStorageComponent

SharedMapLayerData

ShowLayerData

StorageFillComponent

StorageFillVisualizerComponent

Change sprite depending on a storage fill percent.

Enums

SharedBagOpenVisuals

SharedBagState

StorageFillLayers

StorageFillVisuals

StorageMapVisuals

☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾