Class UITKOptions
The client's settings panel: five tabs — Display, Audio, Gameplay, Key Bindings and UI — each built in code and bound directly to GlobalSettings through ClientSettings.
public class UITKOptions : UITKControl
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKOptions
- 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
Controls are generated, not authored. Every row that belongs to a list — audio channels, gameplay toggles, theme colours, key bindings — is built from the table that defines it rather than laid out in the UXML. A configuration key cannot then be lost by editing a scene, which is how all five gameplay toggles were lost once already.
The panel applies nothing at start-up. It used to be the only code that applied
VSync, brightness and the frame-rate cap — from its own OnStarting, which does not
run until the panel is first opened, and the panel ships closed. A player who capped their
frame rate got the bootstrap default every session until they visited the menu. Those
settings are now applied by ClientSettingsBootstrap during boot, and this
panel only reads them back to position its controls and writes them when the player changes
one.
Display settings are staged, not live. Every other setting here can be undone by the control that set it. A display mode cannot: pick one the monitor will not show and the player cannot see the panel that would put it back. So the three display dropdowns write to a pending selection, Apply commits it, and Apply arms a countdown that restores the previous mode unless the player presses Keep. Nothing is written to the configuration file until Keep, so a mode that blacked out the screen is not still there after a restart — and closing the panel while a mode is unconfirmed puts the old one back immediately rather than leaving the player waiting out a countdown with no prompt on screen.
Writes to disk are debounced. Save() serialises and rewrites the whole file; a slider bound straight to it rewrites the file once per frame for as long as it is held. Every write here goes through ClientSettings, which coalesces them, and the panel flushes on close.
Properties
ConsumesEscape
True while a rebind is listening, so Escape cancels it instead of closing this panel.
public override bool ConsumesEscape { get; }
Property Value
Remarks
Escape is not suppressed by RebindingOperation — see BeginRebind(InputAction, int, Button) —
so without this the press reaches Player/CloseLastUI and takes the settings
window down with the rebind it was meant to cancel. CloseNext(bool)
consults this before closing anything, and the flag is still set at that point because
the cancel happens in FishMMO.Client.UITKOptions.PollRebindKeys(), which runs in Update — after the
action callbacks that ask the question.
That ordering is the Input System's ProcessEventsInDynamicUpdate, its default and
what this project uses: events, and so action callbacks, are processed ahead of
MonoBehaviour.Update. Anyone changing InputSettings.updateMode should
re-check this — under a mode that runs actions after Update the rebind would already
have been cancelled by the time the question is asked, and Escape would close the panel
again.
Layer
Draw order tier for this panel. See UITKPanelLayer.
protected override UITKPanelLayer Layer { get; }
Property Value
Methods
Hide(bool)
Flushes anything pending, cancels an in-progress rebind, and settles an unconfirmed display mode when the panel closes.
public override void Hide(bool overrideIsAlwaysOpen)
Parameters
overrideIsAlwaysOpenbool
Remarks
A rebind left listening after the panel is gone would capture the next key the player pressed — in the world, with no prompt on screen — and assign it to whichever action the row belonged to.
An unconfirmed display mode is reverted rather than left to time out. The Keep button is the only thing that can confirm it and closing the panel takes that button away, so waiting out the countdown means sitting in a mode the player cannot confirm and cannot see the prompt for. Reverting immediately is the same outcome, sooner and visibly.
OnAfterShow()
Brings the panel up to date with anything that changed while it was closed.
protected override void OnAfterShow()
Remarks
The bindings and the profile list are both editable from outside this panel — a key binding can be reset by a corrupt-override recovery, a profile file can be added to the folder by hand or dropped in by another player — so both are re-read on every open rather than only when the tree is rebuilt.
OnAfterStarting()
Re-applies state after the visual tree has been rebuilt.
protected override void OnAfterStarting()
Remarks
The panel starts hidden, so its tree is cloned afresh on every open and every element
cached above belongs to the previous one. OnStarting re-runs from
ReinitializeIfTreeReplaced and rebuilds every page; this only has to put the
display prompt back into whatever state the countdown is in, because that state lives
across an open and close.
OnDestroying()
Flushes anything still pending when the panel is destroyed.
public override void OnDestroying()
OnStarting()
Resolves every control, builds every generated list, and binds the callbacks.
public override void OnStarting()
OnTick()
Drives the debounced theme reload and the display auto-revert countdown.
protected override void OnTick()