SusHudTargetPanel

Target chip row — icon + hit % (+ optional label); click / Enter selects a target id.
Package
SusGame · HUD (commercial)
Props
No public props.
Slots
No slots.
Events
| Name | Field | Payload |
|---|---|---|
TargetSelected | OnTargetSelected | string |
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
sus-hud-target-panelsus-hud-target-panel__iconsus-hud-target-panel__itemsus-hud-target-panel__item--selectedsus-hud-target-panel__labelsus-hud-target-panel__pctsus-hud-target-panel__rowsus-hud-target-panel__title
Usage
List-driven: fill from code with SetTargets. XML is chrome only (fixed “TARGETS” title).
csharp
var panel = new SusHudTargetPanel();
panel.OnTargetSelected += id => { /* lock target */ };
panel.SetTargets(new List<SusHudTargetData>
{
new() { Id = "e1", Icon = "crosshair", Label = "Raider", HitChance01 = 0.72f, Selected = true },
new() { Id = "e2", Icon = "crosshair", Label = "Scout", HitChance01 = 0.45f },
});
panel.UpdateHitChance("e1", 0.80f);
panel.SetSelected("e2");xml
<template>
<sus:SusHudTargetPanel @target-selected="OnTargetSelected" />
</template>
<script>
void OnTargetSelected(string id) { /* … */ }
// Call SetTargets / UpdateHitChance / SetSelected from combat code after mount.
</script>| Prop / API | Role |
|---|---|
SetTargets(list) | Rebuild chips from SusHudTargetData |
UpdateHitChance(id, hitChance01) | Patch % without full rebuild |
SetSelected(id) | Toggle --selected class |
ClearTargets() | Remove all chips |
OnTargetSelected | Selected target Id (string) |
Notes
- Empty until
SetTargets(calls before mount queue untilMounted). SusHudTargetData:Id(required),Icon(defaultcrosshair),Label,HitChance01(0…1→N%),Selected.- Keyboard: focused chip activates on Enter / Space.