Table of Contents

Class UITKToast

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

Transient messages stacked at the top of the screen: what just happened, and why it did not.

public class UITKToast : UITKControl
Inheritance
Object
Component
Behaviour
MonoBehaviour
UITKToast
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Remarks

Built general rather than for any one caller. Several server systems already compute a precise reason for refusing something and then have nowhere to put it — BindstoneAction knows whether a bind failed because the player was inside an instance, in the wrong scene, or standing somewhere with too little clearance, and wrote all three to a server-side debug log. The player saw an identical nothing in every case, including success.

Anything may post one: the server through ToastBroadcast, or client code directly through Show(string, ToastSeverity) for things the server never hears about. There is no queue behind the visible set — a toast that would overflow MaximumVisible evicts the oldest instead of waiting, because a message that arrives late enough to be shown after the thing it describes has scrolled past is worse than one that is dropped.

Fields

FadeSeconds

Seconds the fade-out takes once the hold has elapsed.

[Tooltip("Seconds the fade-out takes once the hold expires.")]
public float FadeSeconds

Field Value

float

HoldSeconds

Seconds a toast stays fully visible before it begins to fade.

[Tooltip("Seconds a toast stays fully visible before it begins to fade.")]
public float HoldSeconds

Field Value

float

MaximumLength

Longest text a toast will show. Anything beyond this is truncated with an ellipsis.

public const int MaximumLength = 160

Field Value

int

Remarks

A cap rather than a wrap, so a caller cannot turn this into a scrolling log. The server sends free text, and this is the only thing bounding it.

MaximumVisible

How many toasts may be on screen at once before the oldest is evicted.

public const int MaximumVisible = 5

Field Value

int

Properties

Layer

Draw order tier. Toasts sit with the HUD, above the world and below windows.

protected override UITKPanelLayer Layer { get; }

Property Value

UITKPanelLayer

Methods

OnClientSet()

Subscribes to server-sent toasts.

public override void OnClientSet()

OnClientUnset()

Unsubscribes from server-sent toasts.

public override void OnClientUnset()

OnDestroying()

Clears any live toasts when the panel goes away.

public override void OnDestroying()

OnStarting()

Resolves the stack container from the visual tree.

public override void OnStarting()

Remarks

Re-resolved rather than cached across rebuilds: OnStarting runs again whenever the visual tree is replaced, and an element reference held from the previous tree points at something no longer on screen.

Show(string, ToastSeverity)

Shows a toast.

public void Show(string text, ToastSeverity severity = ToastSeverity.Info)

Parameters

text string

What to show. Truncated at MaximumLength.

severity ToastSeverity

How prominently it reads.

Remarks

Safe to call before the visual tree exists — the toast is dropped rather than queued. A message posted while the HUD is being rebuilt describes something the player has already moved past.