Interface ILauncherView
The presentation surface ClientLauncher drives, keeping the launcher's state machine, version check and patch flow in exactly one place rather than coupled to a widget tree.
public interface ILauncherView
Remarks
Members are expressed as intent ("show this status", "the progress bar is relevant now") rather than as widget manipulation, so an implementation is free to satisfy them however its technology prefers. UITKClientLauncher is currently the only one, but the boundary is worth keeping: it is what stopped the version-check and patch logic from being forked per view while a second implementation existed, and it is why replacing the renderer again would not touch any of it.
Methods
ClearStatus()
Clears any status message so a stale error does not linger into a new state.
void ClearStatus()
SetButtonAction(Action)
Replaces the primary button's click handler. Passing null clears it.
void SetButtonAction(Action action)
Parameters
actionAction
Remarks
Implementations must replace rather than add. The state machine calls this on every transition, and an implementation that accumulated handlers would fire every action the launcher had ever been in.
SetButtonInteractable(bool)
Enables or disables interaction with the primary button.
void SetButtonInteractable(bool interactable)
Parameters
interactablebool
SetButtonText(string)
Sets the label on the primary (Play/Connect/Update) button.
void SetButtonText(string text)
Parameters
textstring
SetInstallSize(long?)
Reports how much disk space the installation occupies, or null when it could not be determined.
void SetInstallSize(long? sizeBytes)
Parameters
sizeByteslong?
Remarks
Null is a real and expected outcome — a permission-restricted install directory, or a measurement that has not run yet. Views must show "unavailable" rather than "0 B", which would read as an empty installation.
SetNewsContent(HtmlNode)
Renders fetched news content into the news pane.
void SetNewsContent(HtmlNode content)
Parameters
contentHtmlNodeRoot of the extracted news fragment.
Remarks
Takes the parsed node rather than a pre-formatted string because UI Toolkit's rich text has no equivalent of a link tag: a news link cannot be markup inside a label, it has to become a real element that can receive a click. Handing the view a formatted string would make that impossible, so the view walks the tree itself.
content is untrusted remote content. Implementations must bound
their traversal depth and must route any link activation through
LauncherLinkPolicy.
SetNewsMessage(string)
Displays plain text in the news pane, used for the loading placeholder and for fetch errors. Distinct from SetNewsContent(HtmlNode) because these messages are launcher-authored strings, not remote content.
void SetNewsMessage(string message)
Parameters
messagestring
SetNewsVisible(bool)
Shows or hides the news pane.
void SetNewsVisible(bool visible)
Parameters
visiblebool
Remarks
The launcher keeps the pane visible in every ordinary case and fills it with a built-in summary when there is no live feed — hiding it collapsed the panel into a header stacked directly on a footer, which reads as a broken window rather than as a launcher with no news today.
SetProgress(DownloadStats)
Reports the state of an in-progress download.
void SetProgress(DownloadStats stats)
Parameters
statsDownloadStats
Remarks
Takes the whole snapshot rather than a progress fraction and a prepared string, so a view can present as much of it as it has room for. Use ToDisplayString() for the standard line unless there is a reason to differ — it already omits whatever is not yet known, which matters because a rate and a remaining time do not exist for the first second of any transfer.
SetProgressVisible(bool)
Shows or hides the progress bar. Hiding also resets progress to zero, so a later download never briefly displays the previous one's final value.
void SetProgressVisible(bool visible)
Parameters
visiblebool
SetQuitAction(Action)
Sets the quit button's click handler. Called once during initialisation.
void SetQuitAction(Action action)
Parameters
actionAction
SetTitle(string)
Sets the launcher window title (project name and version).
void SetTitle(string title)
Parameters
titlestring
SetVisible(bool)
Shows or hides the entire launcher UI.
void SetVisible(bool visible)
Parameters
visibleboolTrue to show the launcher, false to hide it.
Remarks
Called the moment the game scene is ready, before the launcher scene is unloaded. The unload is asynchronous and, in the editor, may not happen at all — the launcher scene is opened directly there rather than through Addressables, so the Addressables unload has no handle for it and silently does nothing. Hiding is synchronous and works either way, so the launcher cannot be left sitting behind the login screen.
ShowStatus(string)
Displays a human-readable status or error message to the player.
void ShowStatus(string message)
Parameters
messagestring
Remarks
The implementation is responsible for ensuring the message is actually visible — including activating whatever container holds it. Writing to a deactivated element silently loses the message, which previously left players facing a two-word button label and no explanation.
Teardown()
Releases anything the view subscribed to. Called from the launcher's OnDestroy.
void Teardown()
Remarks
Present because a view is not required to be a component with its own Unity lifecycle. A plain class owned by the launcher has no OnDestroy of its own, so something has to tell it when to let go. An implementation backed by a MonoBehaviour — UITKClientLauncher is one — may leave this empty and clean up in OnDestroy instead.