SusHudRoot

Full-bleed оболочка HUD — семь absolute-зон (top / tl / tr / center / bl / br / bottom) для chrome-модулей.
Пакет
SusGame · HUD (коммерческий)
Свойства
| Имя | Тип | По умолчанию | |
|---|---|---|---|
Dimmed | Prop<bool> | false |
Слоты
| Имя |
|---|
top |
tl |
tr |
center |
l |
r |
bl |
br |
bottom |
События
Публичных событий нет.
Хуки стиля
Контракт USS-классов — внешний вид переопределяется без правки C#. Состояния переключаются этими классами:
sus-hud-rootsus-hud-root__ability-scrollsus-hud-root__bottom-chromesus-hud-root__bottom-chrome-centersus-hud-root__bottom-chrome-leftsus-hud-root__bottom-chrome-rightsus-hud-root__zonesus-hud-root__zone--blsus-hud-root__zone--bottomsus-hud-root__zone--brsus-hud-root__zone--centersus-hud-root__zone--lsus-hud-root__zone--rsus-hud-root__zone--tlsus-hud-root__zone--topsus-hud-root__zone--trsus-hud-root--dimsus-scrollsus-slot
Использование
Собирайте через именованные слоты в XML или монтируйте виджеты из кода через MountIn.
csharp
var root = new SusHudRoot();
root.Dimmed.Value = false;
root.MountIn(SusHudZone.TL, new SusHudPlayerStatus());
root.MountIn(SusHudZone.Bottom, new SusAbilityBar());
root.MountIn(SusHudZone.BR, new SusHudTurnActions());
// root.ClearZones(); // wipe all zone childrenxml
<template>
<sus:SusHudRoot :Dimmed="Dim.Value">
<template #top><!-- objective / banners --></template>
<template #tl>
<sus:SusHudPlayerStatus />
</template>
<template #tr>
<sus:SusHudMenuButton />
</template>
<template #center><!-- toasts / confirm overlays --></template>
<template #bl><!-- prompts --></template>
<template #br>
<sus:SusHudTurnActions />
</template>
<template #bottom>
<sus:SusAbilityBar />
</template>
</sus:SusHudRoot>
</template>
<script>
public Prop<bool> Dim = new(false);
</script>| Prop / API | Роль |
|---|---|
Dimmed | Добавляет оверлей --dim (rgba-вуаль) |
Slots top · tl · tr · center · bl · br · bottom | Хосты зон |
GetZone(SusHudZone) | Возвращает VisualElement зоны |
MountIn(zone, element) | Добавляет ребёнка в зону |
ClearZones() | Очищает всех детей во всех зонах |
Заметки
- Root и пустые зоны используют
PickingMode.Ignore, чтобы клики по карте проходили насквозь; интерактивные дети сохраняют дефолтный picking. - Зоны — это absolute flex-оболочки; размещайте модули через Assembler /
SusHudModuleKindили монтируйте вручную. SusHudZone:Top,TL,TR,Center,BL,BR,Bottom.