Class UITKRegister
UI Toolkit implementation of the registration control providing username, email, password, age confirmation and an optional key field for account creation.
public class UITKRegister : UITKControl
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKRegister
- 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
Remarks
Field clearing: All input fields are cleared immediately after the register button is pressed, before the network round-trip begins, to minimise the window during which sensitive text resides in the managed heap.
Properties
CanDrag
Full-screen forms are not windows: there is nowhere to drag them to.
protected override bool CanDrag { get; }
Property Value
Remarks
Methods
Hide(bool)
Hides the registration panel and resets the status message.
public override void Hide(bool overrideIsAlwaysOpen)
Parameters
overrideIsAlwaysOpenbool
Remarks
Overrides Hide(bool), not Hide(). Hide() is non-virtual and only
forwards here, so this is the one place teardown can live where every caller reaches
it — quit-to-login calls the bool form directly.
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 form lock after the visual tree was rebuilt.
protected override void OnAfterStarting()
Remarks
SetFormLocked(bool) writes into elements that the next hide/show replaces, so a panel that came back mid-registration — which is what the drop handler and the reply timeout both do — offered an enabled Register button over a request that was still outstanding. Driven off the guard rather than off a second copy of the flag, so the two cannot disagree.
OnClick_QuitToLogin()
Abandons whatever this panel had in flight and hands the screen back to sign-in.
public void OnClick_QuitToLogin()
Remarks
Back — and the Escape key that mirrors it — used to do nothing but clear the fields and
swap the panels, which is correct only for a player who has not pressed Register yet.
Pressed during a registration it left the connection open, isAuthFlowActive set,
the plaintext account password resident in pendingAccountPassword for the rest
of the session, and the 2FA setup file on disk — and because the flow was still
nominally live, the dialogs it goes on to open (the recovery-code display, the
verification prompt) appeared over the login screen the player had just returned to.
This is the same teardown the dialog cancel callbacks perform.
OnClick_Register()
Validates all fields, clears sensitive input immediately, then initiates account creation.
public void OnClick_Register()
OnClientSet()
Subscribes to connection and authentication events when the client is injected.
public override void OnClientSet()
OnClientUnset()
Unsubscribes from connection and authentication events when the client is cleared.
public override void OnClientUnset()
OnQuitToLogin()
Shows and unlocks the registration panel when quitting to login.
public override void OnQuitToLogin()
OnStarting()
Resolves and caches visual elements, populates age dropdown, and wires up button callbacks.
public override void OnStarting()
OnTick()
Per-frame hook for controls that need one.
protected override void OnTick()
SetFormLocked(bool)
Sets the locked state of all form controls (enables/disables interactivity). Also manages the FishMMO.Client.UITKRegister.isAuthFlowActive flag: locking marks the start of a registration flow; unlocking marks its termination.
public void SetFormLocked(bool locked)
Parameters
lockedboolTrue to lock (disable) controls, false to unlock.