Skip to content

SusInventoryCell

SusInventoryCell

Single bag cell — checker even/odd art, occupied fill, drop-target border highlights. No click API of its own (empty-cell clicks bubble to the grid).

Package

SusGame · Inventory (commercial)

Open in Playground

SusGame · Inventory

Props

NameTypeDefault
OccupiedProp<bool>falsev-model
IsEvenProp<bool>falsev-model
HighlightedProp<int>0v-model

Slots

No slots.

Events

No public events.

Style hooks

USS class contract — override appearance without touching C#. States toggle via these classes:

  • sus-inventory-cell
  • sus-inventory-cell--even
  • sus-inventory-cell--highlight-candidate
  • sus-inventory-cell--highlight-invalid
  • sus-inventory-cell--highlight-valid
  • sus-inventory-cell--occupied
  • sus-inventory-cell--odd

Usage

Created by SusInventoryGrid during Refresh — prefer the grid / session. Standalone only for chrome demos:

csharp
var cell = new SusInventoryCell();
cell.CellX = 0;
cell.CellY = 1;
cell.IsEven.Value = true;
cell.Occupied.Value = false;
cell.Highlighted.Value = 0; // 0 none · 1 valid · 2 invalid · 3 candidate
xml
<template>
  <sus:SusInventoryCell :Occupied="Occ.Value"
                        :IsEven="Even.Value"
                        :Highlighted="Hl.Value" />
</template>

<script>
public Prop<bool> Occ = new(false);
public Prop<bool> Even = new(true);
public Prop<int> Hl = new(0);
</script>
Prop / APIRole
OccupiedSolid occupied fill (item sits above)
IsEvenChecker tile (--even / --odd)
HighlightedDrop preview border (0…3)
CellX / CellYGrid coordinates (set by parent)

Notes

  • Drop hints are border-only — never tint cell fill under items (USS contract).
  • Empty-cell click → parent SusInventoryGrid.OnEmptyCellClicked(x, y) (click-to-place).
  • ShowCellArt=false on the shell disables demo tile textures; cells fall back to solid tokens.