Class UITKCharacterSelect
UI Toolkit implementation of the character selection control. Lists the account's characters, allows selecting/connecting/deleting and entering character creation.
public class UITKCharacterSelect : UITKControl
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKCharacterSelect
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.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.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.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.nameObject.hideFlags
Fields
CinematicCamera
Reference to the Cinematic Camera attached to this UI control.
public CinematicCamera CinematicCamera
Field Value
OnCharacterListEnd
Called after OnCharacterListStart finishes.
public Action OnCharacterListEnd
Field Value
OnCharacterListStart
Called when a Character List is received and ready to use.
public Action OnCharacterListStart
Field Value
Properties
CanDrag
Full-screen forms are not windows: there is nowhere to drag them to.
protected override bool CanDrag { get; }
Property Value
Remarks
Methods
DestroyCharacterList()
Forgets the account's characters and removes every row.
public void DestroyCharacterList()
OnAfterShow()
Called at the end of Show(), against the tree the player will actually see. Override to write content that changes from one opening to the next.
protected override void OnAfterShow()
Remarks
This exists because "set the text, then Show" does not work and fails silently. UnityEngine.UIElements.UIDocument clones the UXML on enable, so a panel that fills in its message, list rows or icon before calling Show() writes into a tree that is thrown away microseconds later, and the player sees whatever the UXML declares — an empty dialog, a blank tooltip, a selector with no rows.
Distinct from OnAfterStarting(), which re-applies state after the tree is rebuilt. This one runs on every show, rebuilt tree or not.
OnAfterStarting()
Re-applies the status line and the refresh lock after the visual tree was rebuilt.
protected override void OnAfterStarting()
Remarks
The elements are new after every hide/show, so a message written before the rebuild is gone. This panel is shown precisely because something went wrong, so losing the sentence explaining it would leave an empty list with no explanation.
OnClick_CreateCharacter()
Shows the character creation panel.
public void OnClick_CreateCharacter()
OnClick_DeleteCharacter()
Prompts for confirmation and deletes the selected character if confirmed.
public void OnClick_DeleteCharacter()
OnClick_Quit()
Quits the client application.
public void OnClick_Quit()
OnClick_QuitToLogin()
Stops the character list coroutine and returns to the login screen.
public void OnClick_QuitToLogin()
OnClick_Refresh()
Re-requests the character list.
public void OnClick_Refresh()
Remarks
There was no way to ask twice. The request was sent exactly once per session, from the login panel, and any refusal or loss of it was final for that session.
OnClick_SelectCharacter()
Initiates character selection and connection.
public void OnClick_SelectCharacter()
OnClientSet()
Subscribes to connection, authentication, and character broadcast events when the client is injected.
public override void OnClientSet()
OnClientUnset()
Unsubscribes from connection, authentication, and character broadcast events when the client is cleared.
public override void OnClientUnset()
OnDestroying()
Cleans up the character list when the control is destroyed.
public override void OnDestroying()
OnQuitToLogin()
Stops the character list coroutine and unlocks buttons when quitting to login.
public override void OnQuitToLogin()
OnStarting()
Resolves and caches visual elements and wires up button callbacks.
public override void OnStarting()
OnTick()
Per-frame hook for controls that need one.
protected override void OnTick()
RequestCharacterList()
Asks the server for this account's character list, arming a deadline for the reply.
public void RequestCharacterList()
Remarks
The request used to be broadcast bare from UITKLogin.OnProcessLoginSuccess with
nothing armed on either side. The server has three refusal paths that answer nothing at
all — a 2000ms per-connection cooldown, another request in flight, and the async
handler's catch-all — and the client is at its most exposed at that moment: the login
panel has just hidden itself and this panel only shows when a list arrives. That is the
screen with no panel on it and no way out but Alt+F4.
The server now answers every request (see CharacterListResultBroadcast). This
deadline covers what a reply cannot: a request that never reached the server, and a
server that stops existing between receiving it and answering it.
ReturnFromDownstreamPanel()
Puts this panel back on screen for a player backing out of a screen downstream of it.
public void ReturnFromDownstreamPanel()
Remarks
The selection that took the player away from here is over the moment they come back, so the wait it armed has to be cleared with them. OnClick_SelectCharacter() locks Connect and arms FishMMO.Client.UITKCharacterSelect.replyGuard, and the reply that normally clears it is a broadcast like any other: if it is lost, the panel the player has just returned to comes back with a dead Connect button and then announces, half a minute later, that the server did not respond to a request the player has already abandoned.
Only the panel state is reset. The character list itself is kept — it still describes the same account — so the rows are on screen the moment this returns rather than after another round trip. See OnQuitToLogin() for the case where the list must go.