Class UITKInventory
UI Toolkit implementation of the inventory panel.
Binds to UIInventory.uxml / UIInventory.uss and renders the character's
inventory as a grid of slot buttons. Item drag-and-drop and tooltips reuse the shared
UITKDragObject and UITKTooltip overlays via UIManager.
public class UITKInventory : UITKCharacterControl
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKInventory
- 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
The grid is a view of the replicated container and nothing else: no click here writes to a slot. A request goes out, the slot is marked as waiting, and the container being replicated back is what changes what the player sees. Anything else is a guess that the server is free to contradict — and until ItemOperationFailedBroadcast existed, would contradict silently.
Methods
Hide(bool)
Hides the panel and abandons anything it had in flight.
public override void Hide(bool overrideIsAlwaysOpen)
Parameters
overrideIsAlwaysOpenboolWhen true, the call is a no-op.
Remarks
Hide(bool) and not Hide(): Escape arrives via UIManager.CloseNext
and quit-to-login via Hide(false), and a drag or a pending mark that outlives the
panel is one the player can neither see nor cancel.
OnAfterShow()
Fills the grid on every show, including the very first one.
protected override void OnAfterShow()
Remarks
THE CONTRACT: enabling the document re-clones the UXML, so anything written before
Show() is discarded. OnAfterStarting covers later opens, but on the first
ever open hasStarted is still false and ReinitializeIfTreeReplaced bails
out before calling it — so the work has to happen from both hooks. It is idempotent:
the grid is rebuilt only when it is actually stale, otherwise the slots are repainted
in place.
OnAfterStarting()
Rebuilds the grid after the visual tree has been replaced.
protected override void OnAfterStarting()
Remarks
The base implementation re-runs the character pre/post pair, which is what recreates the slot elements against the new tree. FishMMO.Client.UITKInventory.ApplyPerOpenContent() then repaints the pending marks, which live in the shared tracker rather than in the tree.
OnClientSet()
Joins the shared item-operation tracker.
public override void OnClientSet()
OnClientUnset()
Leaves the shared item-operation tracker.
public override void OnClientUnset()
OnDestroying()
Destroys all runtime slot elements and drops every subscription when the control is destroyed.
public override void OnDestroying()
OnInventorySlotLockChanged(IItemContainer, int, bool)
Called when the lock state of an inventory slot changes.
public void OnInventorySlotLockChanged(IItemContainer container, int slot, bool isLocked)
Parameters
containerIItemContainerslotintisLockedbool
OnInventorySlotUpdated(IItemContainer, Item, int)
Called when an inventory slot's item changes.
public void OnInventorySlotUpdated(IItemContainer container, Item item, int inventoryIndex)
Parameters
containerIItemContaineritemIteminventoryIndexint
Remarks
The slot arriving from the server IS the acknowledgement of whatever this panel asked for, so the pending mark is released here rather than on a separate reply message.
OnPostSetCharacter()
Builds the inventory grid for the newly set character and subscribes to slot events.
public override void OnPostSetCharacter()
OnPreSetCharacter()
Unsubscribes from inventory slot events before the character is replaced.
public override void OnPreSetCharacter()
OnPreUnsetCharacter()
Drops every subscription and in-flight operation before the character goes away.
public override void OnPreUnsetCharacter()
Remarks
Quit-to-login and a character switch both come through here. Nothing else unsubscribes on this path, so without it the panel stays wired to a character that is being destroyed and keeps slots marked as waiting on a server it is no longer talking to.
OnStarting()
Queries named elements and wires up the close button.
public override void OnStarting()
OnTick()
Times out item operations whose reply never arrived.
protected override void OnTick()