Skip to content

SusEquipmentSlot

SusEquipmentSlot

Single gear slot — label, empty/filled chrome, equipped SusInventoryItem icon, drop highlight, context menu.

Package

SusGame · Inventory (commercial)

Open in Playground

SusGame · Inventory

Props

NameTypeDefault
SlotIdProp<string>""v-model
SlotNameProp<string>""v-model
SlotIconProp<string>""v-model
EquippedItemProp<ItemInstance>nullv-model
HighlightedProp<int>0v-model
RarityProp<string>""v-model

Slots

No slots.

Events

NameFieldPayload
SlotClickOnSlotClickstring
ItemClickedOnItemClickedSusInventoryItem, string
ItemDragStartOnItemDragStartSusInventoryItem, string
ItemDragEndOnItemDragEndSusInventoryItem
ItemDraggingOnItemDraggingSusInventoryItem, Vector2
ItemContextActionOnItemContextActionstring, SusInventoryItem

Style hooks

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

  • sus-equipment-slot
  • sus-equipment-slot__bg
  • sus-equipment-slot__frame
  • sus-equipment-slot__frame--rarity-common
  • sus-equipment-slot__frame--rarity-epic
  • sus-equipment-slot__frame--rarity-exotic
  • sus-equipment-slot__frame--rarity-legendary
  • sus-equipment-slot__frame--rarity-rare
  • sus-equipment-slot__frame--rarity-uncommon
  • sus-equipment-slot__icon
  • sus-equipment-slot__label
  • sus-equipment-slot--empty
  • sus-equipment-slot--filled
  • sus-equipment-slot--highlight-candidate
  • sus-equipment-slot--highlight-invalid
  • sus-equipment-slot--highlight-valid
  • sus-inventory-item

Usage

Prefer parent SusEquipmentPanel (or SusInventory session) — the panel sets id/size/categories and paints the item. Standalone for Storybook / custom paper-doll:

csharp
var slot = new SusEquipmentSlot();
slot.SlotId.Value = "helm";
slot.SlotName.Value = "Helmet";
slot.GridWidth = 2;
slot.GridHeight = 2;
slot.CellSize = 48f;
slot.ItemMedia = "image";
slot.CellLayout = "grid";
slot.AllowedCategories = new[] { "armor" };
slot.Model = model;
slot.EquippedItem.Value = equippedInstance; // or null
slot.OnSlotClick += id => { /* unequip path */ };
slot.OnItemClicked += (item, id) => { /* select */ };
slot.UpdateItemIcon();
xml
<template>
  <sus:SusEquipmentSlot :SlotId="Id.Value"
                        :SlotName="Name.Value"
                        :Highlighted="Hl.Value" />
</template>

<script>
public Prop<string> Id = new("helm");
public Prop<string> Name = new("Helmet");
public Prop<int> Hl = new(0);
// EquippedItem / Model / AllowedCategories — set from C# after mount.
</script>
Prop / APIRole
SlotId / SlotNameIdentity + label
EquippedItemBound ItemInstance (null = empty)
Highlighted0 none · 1 valid · 2 invalid · 3 candidate
GridWidth / GridHeight / CellSizeFootprint px = cells × size
AllowedCategoriesCategory gate for Accepts(ItemDef)
UpdateItemIcon()Repaint equipped icon from Model
Accepts(def)Category check
OnSlotClick / OnItem* / OnItemContextActionEvents

Notes

  • Context actions on the item: equip / unequip / delete (same as bag items).
  • Click on empty chrome fires OnSlotClick(SlotId) — bag layout unequips into bag; loadout opens category flyout (shell-owned).
  • Highlight values match SusInventoryCell.