SusHudTurnActions

回合外框列——Wait / End Turn 按钮,外加作为长按按钮的 Confirm。
包
SusGame · HUD(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
WaitLabel | Prop<string> | "Wait" | |
EndTurnLabel | Prop<string> | "End Turn" | |
ConfirmLabel | Prop<string> | "Confirm" | |
ConfirmEnabled | Prop<bool> | true | |
WaitVisible | Prop<bool> | true | |
EndTurnVisible | Prop<bool> | true | |
ConfirmVisible | Prop<bool> | true |
插槽
没有插槽。
事件
| 名称 | 字段 | 载荷 |
|---|---|---|
Wait | OnWait | — |
EndTurn | OnEndTurn | — |
ConfirmHold | OnConfirmHold | — |
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
sus-hold-buttonsus-hud-turn-actionssus-hud-turn-actions__btnsus-hud-turn-actions__confirm
用法
绑定按钮文本 / 可见性,或用 ApplyData 批量推送。
csharp
var actions = new SusHudTurnActions();
actions.WaitLabel.Value = "Wait";
actions.EndTurnLabel.Value = "End Turn";
actions.ConfirmLabel.Value = "Confirm";
actions.ConfirmEnabled.Value = true;
actions.WaitVisible.Value = true;
actions.EndTurnVisible.Value = true;
actions.ConfirmVisible.Value = true;
actions.OnWait += () => { /* skip AP */ };
actions.OnEndTurn += () => { /* commit turn */ };
actions.OnConfirmHold += () => { /* confirm aim / fire */ };
// Or batch:
actions.ApplyData(new SusHudTurnActionsData
{
ConfirmEnabled = false,
WaitVisible = false,
});xml
<template>
<sus:SusHudTurnActions :WaitLabel="Wait.Value"
:EndTurnLabel="End.Value"
:ConfirmLabel="Confirm.Value"
:ConfirmEnabled="ConfirmOk.Value"
:WaitVisible="ShowWait.Value"
:EndTurnVisible="ShowEnd.Value"
:ConfirmVisible="ShowConfirm.Value"
@wait="OnWait"
@end-turn="OnEndTurn"
@confirm-hold="OnConfirmHold" />
</template>
<script>
public Prop<string> Wait = new("Wait");
public Prop<string> End = new("End Turn");
public Prop<string> Confirm = new("Confirm");
public Prop<bool> ConfirmOk = new(true);
public Prop<bool> ShowWait = new(true);
public Prop<bool> ShowEnd = new(true);
public Prop<bool> ShowConfirm = new(true);
void OnWait() { /* … */ }
void OnEndTurn() { /* … */ }
void OnConfirmHold() { /* … */ }
</script>| Prop / API | Role |
|---|---|
WaitLabel · EndTurnLabel · ConfirmLabel | 按钮文本(默认 Wait / End Turn / Confirm) |
ConfirmEnabled | 为 false 时禁用 Confirm 长按 |
WaitVisible · EndTurnVisible · ConfirmVisible | 显示 / 隐藏各控件 |
ApplyData(SusHudTurnActionsData) | 批量设置文本与标志位 |
OnWait · OnEndTurn · OnConfirmHold | 点击 / 长按完成 |
备注
- Confirm 使用 kit 的
SusHoldButton(ProgressMode=strip,HoldDurationMs=700)。 - Wait / End Turn 使用 kit 的
SusButton(outlinedsecondary /elevatedprimary,Size=small)。 - 当外框每个阶段都会变化时,优先从 Assembler / 战术宿主调用
ApplyData。