SusInteractPrompt

Single interact hint — key badge + text; click / keyboard fires OnInteract.
Package
SusGame · HUD (commercial)
Props
| Name | Type | Default | |
|---|---|---|---|
Key | Prop<string> | "E" | |
Text | Prop<string> | "Interact" | |
Visible | Prop<bool> | true | |
BindAction | Prop<string> | (string)null |
Slots
No slots.
Events
| Name | Field | Payload |
|---|---|---|
Interact | OnInteract | — |
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
sus-interact-promptsus-interact-prompt__keysus-interact-prompt__textsus-interact-prompt--hidden
Usage
csharp
var prompt = new SusInteractPrompt();
prompt.Key.Value = "E";
prompt.Text.Value = "Open door";
prompt.Visible.Value = true;
prompt.OnInteract += () => { /* use / open */ };xml
<template>
<sus:SusInteractPrompt :Key="Key.Value"
:Text="Label.Value"
:Visible="Show.Value"
@interact="OnInteract" />
</template>
<script>
public Prop<string> Key = new("E");
public Prop<string> Label = new("Open door");
public Prop<bool> Show = new(true);
void OnInteract() { /* … */ }
</script>| Prop / API | Role |
|---|---|
Key | Badge text (default E) |
Text | Action label (rendered as — {Text}) |
Visible | Toggles --hidden (display: none) |
OnInteract | Click or keyboard activate |
Notes
- Keyboard handler accepts
E/ Space / Enter when visible (badgeKeyis display; activation keys are fixed in component). - Host several prompts in SusPromptBar via
SetPrompts/AddPrompt.