Class Bank


public final class Bank extends InventoryContainer
The bank inventory (inv id 95). The bank UI lives at iface 517 with a separate component for the bank slot grid. Singleton per GameAPI; obtain via api.bank().

Inherits read/containment/slot interactions from InventoryContainer. The high-level verbs (depositAll(), withdraw(int, Bank.TransferAmount), presets, ...) queue COMPONENT actions against iface 517.

Every interface, component and variable the verbs touch is addressed by its gameval name through GameAPI.gamevals(), so a game renumber is fixed by refreshing the gameval index rather than by editing this class. The literal ids are only the fallback for a host with no index deployed; they were checked against the gameval table, the CS2 menu-op layout and the V1 bank API.

Item-slot menus on both the banked-items grid and the bank's backpack grid share one op layout: 1 default quantity, 2 one, 3 five, 4 ten, 5 last X, 6 enter X, 7 all.

  • Field Details

    • INVENTORY_ID

      public static final int INVENTORY_ID
      See Also:
    • INTERFACE_ID

      public static final int INTERFACE_ID
      See Also:
    • COMPONENT_ID

      public static final int COMPONENT_ID
      Banked-items slot grid (BANK__BANK_INV). The slot interactions inherited from InventoryContainer bind this literal; the verbs on this class resolve it by name. Component 195 is the grid's scrollbar.
      See Also:
    • BACKPACK_COMPONENT

      public static final int BACKPACK_COMPONENT
      Backpack items shown inside the bank interface (BANK__INVENTORY_CLICK).
      See Also:
    • INPUT_INTERFACE

      public static final int INPUT_INTERFACE
      Withdraw-X / Deposit-X input layer (MESLAYER).
      See Also:
  • Constructor Details

  • Method Details

    • isOpen

      public boolean isOpen()
      True when the bank UI (iface 517) is open.
    • isInputOpen

      public boolean isInputOpen()
      True when the withdraw-X / deposit-X dialog is up.
    • getWithdrawAmount

      public int getWithdrawAmount()
      Currently configured custom withdraw amount.
    • getPresetPage

      public int getPresetPage()
      Preset page (0 for presets 1-9, 1 for 10-18).
    • view

      public Bank.SideView view()
      Side-panel view alongside the bank grid.
    • withdrawMode

      public Bank.WithdrawMode withdrawMode()
      Withdraw mode — items as-is or as bank notes.
    • setting

      public Bank.BankSetting setting()
      Bank interface setting — standard transfer or preset selector.
    • transferMode

      public Bank.TransferAmount transferMode()
      Currently selected transfer mode (1 / 5 / 10 / custom / all).
    • close

      public boolean close()
      Click the bank's close (X) button. No-op when the bank isn't open.
    • depositAll

      public boolean depositAll()
      Deposit carried backpack contents.
    • depositEquipment

      public boolean depositEquipment()
      Deposit worn equipment.
    • depositFamiliar

      public boolean depositFamiliar()
      Deposit familiar inventory.
    • depositCoins

      public boolean depositCoins()
      Deposit coin pouch.
    • depositEverything

      public boolean depositEverything()
      Deposit carried items + equipment + familiar + coins, in order.
    • deposit

      public boolean deposit(int itemId, Bank.TransferAmount amount)
      Deposit one stack of itemId from the backpack-inside-bank panel. Returns false when the bank isn't open or the item isn't in the backpack.
    • startDepositX

      public boolean startDepositX(int itemId)
      Open the deposit-X dialog for itemId.
    • finishTransferX

      public boolean finishTransferX(int amount)
      Finish a deposit-X or withdraw-X: type amount into the enter-amount dialog and submit it, through InputDialog.enterAmount(long). Returns false, sending nothing, when the bank is not open or the dialog is not asking for an amount. A true return means queued: the digits and Enter land one per game tick, so the item count moves that many ticks later.
      Throws:
      IllegalArgumentException - when amount is negative
    • withdraw

      public boolean withdraw(int itemId, Bank.TransferAmount amount)
      Withdraw one stack of itemId with the given transfer amount.
    • withdrawAll

      public boolean withdrawAll(int itemId)
      Withdraw the entire stack of itemId.
    • startWithdrawX

      public boolean startWithdrawX(int itemId)
      Open the withdraw-X dialog for itemId.
    • withdrawPreset

      public boolean withdrawPreset(int presetNumber)
      Withdraw a saved bank preset (1-18) through the quick-preset buttons, flipping to the preset's page first when needed (presets 10-18 live on the second page). The caller is responsible for waiting for the bank to drain — this method only queues the clicks.
    • setTransferMode

      public boolean setTransferMode(Bank.TransferAmount mode)
      Select the bank's quantity-mode button.