Class UITKBank
UI Toolkit implementation of the bank panel.
public class UITKBank : UITKItemGridPanel
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKBank
- 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.MemberwiseClone()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, its slots, drag-and-drop, tooltips and the capacity readout all live in UITKItemGridPanel, which the inventory panel shares. What is left here is what is actually particular to a bank: it is opened by a banker rather than by a keybind, its slots belong to the bank container, and a move into it is a bank swap.
Properties
DragType
The drag and operation-tracker identity of this panel's slots.
protected override ReferenceButtonType DragType { get; }
Property Value
OpensInventoryOnShow
True for a panel that should bring the inventory up alongside itself when it opens.
protected override bool OpensInventoryOnShow { get; }
Property Value
Remarks
Interaction panels — shops, the bank — are where the player is about to move items, and opening one without the inventory meant a second key press before anything could be dragged. Each such panel exposes an inspector toggle and overrides this to return it; the default is off so HUD elements and dialogs stay out of it. (Issue #208.)
OwnInventoryType
This panel's container, as the server names it in a request.
protected override InventoryType OwnInventoryType { get; }
Property Value
Prefix
Element and USS name prefix for this panel, without a trailing dash.
protected override string Prefix { get; }
Property Value
Remarks
"bank", "inv", "eq". Every panel-specific class name is this prefix plus a fixed suffix, which is what lets the two USS names this class needs be derived rather than declared three times. A panel whose markup does not follow the pattern overrides the names below instead of bending the prefix.
QuickTransferTarget
The container a shift-click sends an item to, or null when this panel has nowhere to send one.
protected override ReferenceButtonType? QuickTransferTarget { get; }
Property Value
Methods
HandleSlotRightClick(int)
Right-click wears the item if it can be worn, and otherwise offers to split it.
protected override void HandleSlotRightClick(int slotIndex)
Parameters
slotIndexintThe slot that was clicked.
Remarks
The bank used to inherit the grid's meaning for this click and nothing else, so a right-click on a sword did nothing at all — UITKItemGridPanel's handler only prompts for a stack, and a sword is not one — and the one way to equip out of the bank was to press, drag and release on the single socket the item's own template names. The same click in the bag wears the item, so the gesture players already have was silently a no-op here. Issue #268.
The destination comes from the item's template rather than from where the pointer is, which is what makes one click enough: a breastplate has exactly one socket it can go to.
No trade branch, unlike the inventory: a trade offer is drawn from the inventory, so a bank slot has nothing to be offered to.
OnAfterShow()
Hides each module link and asks its module whether to show it.
protected override void OnAfterShow()
OnClientSet()
Registers the banker broadcast handler and joins the shared operation tracker.
public override void OnClientSet()
OnClientUnset()
Unregisters the banker broadcast handler and leaves the shared operation tracker.
public override void OnClientUnset()
OnStarting()
Builds the modules' link buttons (the Housing module's house vault). Each starts hidden; its module shows it when there is something behind it, asked every time the bank opens (OnAfterShow()).
public override void OnStarting()
SendQuickTransferRequest(int, int)
Sends the request that moves an item out of this panel and into QuickTransferTarget.
protected override void SendQuickTransferRequest(int fromSlot, int toSlot)
Parameters
fromSlotintSlot in this panel the item is leaving.
toSlotintSlot in the target container it is going to.
Remarks
The broadcast belongs to the DESTINATION container, not this one — moving into the bank is a bank swap whoever asked for it — so the panel losing the item is the one that has to name the other panel's request.
SendSplitRequest(int, int, InventoryType, uint)
Asks the server to split part of a stack into one of this panel's slots. Issue #198.
protected override void SendSplitRequest(int fromSlot, int toSlot, InventoryType fromInventory, uint amount)
Parameters
fromSlotintSlot holding the stack being split.
toSlotintSlot in this panel the split half is going to.
fromInventoryInventoryTypeContainer holding the stack being split.
amountuintHow much to take off it.
Remarks
As with SendSwapRequest(int, int, InventoryType), the request names its DESTINATION container, so the panel receiving the split half is the one that sends it.
SendSwapRequest(int, int, InventoryType)
Asks the server to move an item into one of this panel's slots.
protected override void SendSwapRequest(int fromSlot, int toSlot, InventoryType fromInventory)
Parameters
fromSlotintSlot the item is leaving.
toSlotintSlot in this panel it is going to.
fromInventoryInventoryTypeContainer the item is leaving.
Remarks
The only part of a drop that differs between panels: the request carries the same three fields either way, but the broadcast type names its destination container.