Currency container: a balance per StringName id (e.g. &"coins", &"gems"). Standalone or an Inventory sub-component. No implicit cap; games enforce caps externally via can_afford / add / remove round-trips. Mutations are atomic: add/remove return the new balance or a negative number on failure, so callers can roll back.
Source: addons/item_vault/inventory/wallet.gd
Syntax
class Wallet extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
currency_changed | Signal | Emitted whenever any currency's balance changes. payload: { "currency": StringName, "old": int, "new": int } |
get_balance | Method | |
can_afford | Method | |
balances | Method | |
currencies | Method | |
add | Method | |
remove | Method | |
set_balance | Method | |
clear | Method | |
transfer_from | Method | |
merge_from | Method | |
to_dict | Method | |
from_dict | Method |