К содержимому

SusHudItemStrip

SusHudItemStrip

Ряд расходников / quick-item — icon + count на слот, фокус стрелками, activate-callback.

Пакет

SusGame · HUD (коммерческий)

Открыть в песочнице

SusGame · HUD

Свойства

ИмяТипПо умолчанию
SlotCountProp<int>5

Слоты

Слотов нет.

События

ИмяПолеPayload
ItemActivatedOnItemActivatedint

Хуки стиля

Контракт USS-классов — внешний вид переопределяется без правки C#. Состояния переключаются этими классами:

  • sus-hud-item-strip
  • sus-hud-item-strip__count
  • sus-hud-item-strip__icon
  • sus-hud-item-strip__key
  • sus-hud-item-strip__slot

Использование

csharp
var strip = new SusHudItemStrip();
strip.SlotCount.Value = 5;
strip.OnItemActivated += index => { /* consume / equip */ };

strip.SetItem(0, "potion", "3");
strip.SetItem(1, "bandages", "12");
strip.SetItem(2, "flare", "1");
xml
<template>
  <sus:SusHudItemStrip :SlotCount="Slots.Value"
                       @item-activated="OnItemActivated" />
</template>

<script>
public Prop<int> Slots = new(5);
void OnItemActivated(int index) { /* … */ }
// Call SetItem after mount (slots rebuild on SlotCount).
</script>
Prop / APIРоль
SlotCountСлоты 1…12 (по умолчанию 5)
SetItem(i, icon, countText?)Заполняет один слот
OnItemActivatedИндекс клика / активации

Заметки

  • Иконки пусты, пока не вызван SetItem — заполняйте после монтирования, как у SusHotbar.
  • Клавиатура: Left/Right двигают фокус; активация по клику (и через host key wiring).
  • Предпочитайте hotbar, когда нужны keybind-цифры + selection chrome; item strip — более плотный ряд с count-бейджами.