Skip to content

SusReconnectOverlay ​

SusReconnectOverlay

Mid-match connection-loss banner — a reconnecting progress track with a timer, switching to a failed state with retry and optional leave actions.

Package

SusGame · HUD (commercial)

Open in Playground

SusGame · HUD

Props

NameTypeDefault
OpenProp<bool>false
FailedProp<bool>false
KickerProp<string>"CONNECTION LOST"
TextProp<string>"Reconnecting…"
RetryTextProp<string>"RETRY"
LeaveTextProp<string>"Leave"
CanLeaveProp<bool>false
TimerFormatProp<string>"{0}s"
TimerProp<string>""
ProgressProp<float>0f

Slots

No slots.

Events

NameFieldPayload
DeadlineOnDeadline—

Style hooks ​

USS class contract — override appearance without touching C#. States toggle via these classes:

  • sus-hidden
  • sus-reconnect
  • sus-reconnect__btn
  • sus-reconnect__kicker
  • sus-reconnect__leave
  • sus-reconnect__row
  • sus-reconnect__text
  • sus-reconnect__timer
  • sus-reconnect__track
  • sus-reconnect--can-leave
  • sus-reconnect--failed
  • sus-reconnect--open

Usage ​

xml
<sus:SusReconnectOverlay />
csharp
overlay.OnDeadline = () => overlay.ShowFailed(onRetry: Reconnect, onLeave: BackToMenu);
overlay.ShowReconnect(deadlineSeconds: 30f);
Prop / APIRole
Kicker / TextHeadline and message. Defaults "CONNECTION LOST", "Reconnecting…"
RetryText / LeaveTextButton labels. Defaults "RETRY", "Leave"
TimerFormat / TimerCountdown format, {0} = whole seconds left (default "{0}s"), and the current text
ProgressTime left, 1 → 0
ShowReconnect(deadlineSeconds, text)Reconnecting state with a countdown
ShowFailed(onRetry, onLeave, text)Failed state with retry and leave
ShowFailed(text) / Show(kicker, text) / Hide()Earlier overloads, unchanged
OnDeadlineCalled once when the countdown runs out
Btn / LeaveBtnRetry and leave buttons

Deadline ​

ShowReconnect(deadlineSeconds) counts down in unscaled time, so a paused game (timeScale = 0) still counts. When the time is up the countdown stops and OnDeadline is called; with no OnDeadline set, the overlay switches to the failed state by itself. A non-positive deadline is already up. With SusMotion.Reduce on, the bar steps once per second instead of sliding; the countdown itself still runs.

Retry and leave ​

ShowFailed(onRetry, onLeave) wires the retry button (Btn) to onRetry and the leave button (LeaveBtn, class sus-reconnect__leave) to onLeave, replacing their earlier click handlers. The leave button shows only when onLeave is not null.

The default texts go through the SusGame String Table; a value you set yourself wins. See Localized strings.