SusHudWeaponPanel

Weapon option row — kit buttons with icon / label; click selects a weapon id.
Package
SusGame · HUD (commercial)
Props
No public props.
Slots
No slots.
Events
| Name | Field | Payload |
|---|---|---|
WeaponSelected | OnWeaponSelected | string |
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
sus-hud-weapon-panelsus-hud-weapon-panel__btnsus-hud-weapon-panel__rowsus-hud-weapon-panel__title
Usage
List-driven: SetWeapons. XML is chrome only (fixed “WEAPON” title).
csharp
var panel = new SusHudWeaponPanel();
panel.OnWeaponSelected += id => { /* equip / mode */ };
panel.SetWeapons(new List<SusHudWeaponOption>
{
new() { Id = "rifle", Label = "Rifle", Icon = "crosshair", Description = "Mid range", Selected = true },
new() { Id = "shotgun", Label = "Shotgun", Icon = "target", Description = "Close" },
});
panel.SetSelected("shotgun");xml
<template>
<sus:SusHudWeaponPanel @weapon-selected="OnWeaponSelected" />
</template>
<script>
void OnWeaponSelected(string id) { /* … */ }
// Call SetWeapons / SetSelected from loadout / combat code after mount.
</script>| Prop / API | Role |
|---|---|
SetWeapons(list) | Build / in-place update from SusHudWeaponOption |
SetSelected(id) | Active + tonal vs outlined |
ClearWeapons() | Remove all buttons |
OnWeaponSelected | Selected weapon Id (string) |
Notes
- Empty until
SetWeapons(pre-mount calls queue). SusHudWeaponOption:Id,Label,Icon(PrependIcon),Description(tooltip),Selected.- Same id set → state update without remount (avoids button size thrash).