Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.
Source: addons/item_vault/inventory/wallet.gd
Syntax
class Wallet extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
currency_changed | Event | Currency container. Sub-component of ItemContainer, but also usable standalone. Currencies are identified by StringName (e.g. &"coins", &"gems", &"research_points"). The wallet tracks a balance per currency id. There is no implicit cap; cap logic lives in the game (e.g. weight, level, quest progress) and is enforced externally via can_afford / add / remove round-trips. A wallet may be a sub-component of an Inventory (so a player has one container holding both items and currencies) or a standalone instance (e.g. an NPC's quest reward pool). The class doesn't care. Buy/sell transactions move currencies atomically: add_coins() and remove_coins() return the new balance or a negative number on failure, so callers can roll back on partial failure. Emitted whenever any currency's balance changes. payload: { "currency": StringName, "old": int, "new": int } |
get_balance | Method | |
can_afford | Method | |
balances | Method | |
currencies | Method | |
out | Property | |
add | Method | |
old_balance | Property | |
new_balance | Property | |
remove | Method | |
old_balance | Property | |
taken | Property | |
new_balance | Property | |
set_balance | Method | |
old_balance | Property | |
clear | Method | |
affected | Property | |
transfer_from | Method | |
taken | Property | |
result | Property | |
merge_from | Method | |
n | Property | |
bal | Property | |
to_dict | Method | |
d | Property | |
bal | Property | |
from_dict | Method | |
currency | Property | |
amount | Property |
Source
addons/item_vault/inventory/wallet.gd
Plugin docs root:gdscript/plugins/item_vault_dev/addons/item_vault/guides