跳转到内容

SusGameSessionScreenContent

SusGameSessionScreenContent

全出血比赛外壳 — 通过 HUD 预设挂载 SusHudRoot、session chrome(turn/phase/hint/quit)、可选的结果遮罩层。

SusGame · 屏幕(商业)

在 Playground 中打开

SusGame · Screens

属性

名称类型默认值
TurnNumberProp<int>1
TurnLabelProp<string>"Turn 1"
PhaseProp<string>"deployment"
PhaseLabelProp<string>"Deployment"
IsPlayerTurnProp<bool>true
ActiveActionProp<string>""
ShowResultProp<bool>false
ResultTextProp<string>""
ActionHintProp<string>""
HudPresetIdProp<string>SusHudPresetRegistry.Tactical

插槽

没有插槽。

事件

没有公开事件。

样式钩子

USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:

  • sc-gs-actionbar
  • sc-gs-result-overlay
  • sc-gs-topbar
  • sus-flow-hint
  • sus-flow-hint--flush
  • sus-game-session-action-btn
  • sus-game-session-screen
  • sus-game-session-screen__hint
  • sus-game-session-screen__phase-label
  • sus-game-session-screen__quit-btn
  • sus-game-session-screen__turn-label
  • sus-menu-button

用法

绑定 chrome props;修改 HudPresetId 或调用 ApplyHudPreset 来切换模块。从宿主为 QuitBtn / ResultOkBtn 接线。

xml
<template>
  <sus:SusGameSessionScreenContent
    :TurnNumber="Turn.Value"
    :TurnLabel="TurnLbl.Value"
    :Phase="PhaseId.Value"
    :PhaseLabel="PhaseLbl.Value"
    :ActionHint="Hint.Value"
    :ShowResult="ShowEnd.Value"
    :ResultText="Result.Value"
    :HudPresetId="Preset.Value"
  />
</template>

<script>
public Prop<int> Turn = new(1);
public Prop<string> TurnLbl = new("Turn 1");
public Prop<string> PhaseId = new("deployment");
public Prop<string> PhaseLbl = new("Deployment");
public Prop<string> Hint = new("");
public Prop<bool> ShowEnd = new(false);
public Prop<string> Result = new("");
public Prop<string> Preset = new(SusHudPresetRegistry.Deployment);
</script>
csharp
var session = new SusGameSessionScreenContent();
session.HudPresetId.Value = SusHudPresetRegistry.Tactical;
session.ApplyHudPreset(SusHudPresetRegistry.Tactical);
// After mount — AbilityBar / MinimapFrame / ObjectivePanel from HudMount
session.TurnNumber.Value = 3;
session.PhaseLabel.Value = "Action";
session.ActionHint.Value = "Select a unit";
session.ShowResult.Value = true;
session.ResultText.Value = "Victory";
session.QuitBtn.OnClick += () => { /* confirm quit */ };
session.ResultOkBtn.OnClick += () => { /* dismiss result */ };
Prop / APIRole
TurnNumber / TurnLabel回合芯片(TurnLabel 非空时优先)
Phase / PhaseLabel阶段芯片文本
ActionHintChrome 提示 alert;为空 → 隐藏
ShowResult / ResultText结果遮罩层可见性 + 文案
HudPresetId变化时触发 ApplyHudPreset
IsPlayerTurn / ActiveAction已声明的 Prop<> — 当前 pin 未接入 chrome UI
HudRoot / HudMountRoot + 最近一次 SusHudAssembler.Apply 的结果
AbilityBar / MinimapFrame / ObjectivePanel来自挂载点的引用(按预设可能为 null)
QuitBtn / ResultOkBtn / ActionBar宿主接线
ApplyHudPreset(id)重新应用 assembler + 重建 session chrome

备注

  • 默认预设 = SusHudPresetRegistry.Deployment。空 id 回退到 Tactical
  • ApplyHudPreset 会在挂载的面板上填充演示用目标(Deploy units / Complete the mission)— 正式任务请从宿主替换。
  • Session chrome 期望预设提供 session-chrome 自定义宿主;否则挂载到 TL