SusInventoryCell

单个背包格子 — 棋盘式奇偶格美术、占用填充、放置目标边框高亮。自身无点击 API(空格子点击会冒泡到网格)。
包
SusGame · 库存(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Occupied | Prop<bool> | false | v-model |
IsEven | Prop<bool> | false | v-model |
Highlighted | Prop<int> | 0 | v-model |
插槽
没有插槽。
事件
没有公开事件。
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
sus-inventory-cellsus-inventory-cell--evensus-inventory-cell--highlight-candidatesus-inventory-cell--highlight-invalidsus-inventory-cell--highlight-validsus-inventory-cell--occupiedsus-inventory-cell--odd
用法
由 SusInventoryGrid 在 Refresh 期间创建 — 优先使用网格 / session。仅在外观演示中独立使用:
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 candidatexml
<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 / API | 作用 |
|---|---|
Occupied | 实心占用填充(物品叠放其上) |
IsEven | 棋盘格瓦片(--even / --odd) |
Highlighted | 放置预览边框(0…3) |
CellX / CellY | 网格坐标(由父组件设置) |
备注
- 放置提示仅限边框 — 绝不为物品下方的格子填充着色(USS 契约)。
- 空格子点击 → 父组件
SusInventoryGrid.OnEmptyCellClicked(x, y)(点击放置)。 - 外壳上的
ShowCellArt=false会禁用演示瓦片贴图;格子将回退为纯色 token。