Functions Reference
Godot 4 · GDScript · Currency & store
get_inventory
Fetches the player's permanent inventory (items owned in this game).
Asynchronous (result via signal)
Signature
get_inventory() -> voidWhat it does
GETs /currency/inventory (session-auth). items is an Array of Dictionary, each { item_id, source, acquired_at, metadata }. On no active session it pushes a warning and emits inventory_loaded([]) immediately.
Parameters
This function takes no parameters.
How to call it
Connect inventory_loaded first, then call get_inventory(). A common pattern is to call it right after the session is ready to unlock owned content.
Result signal: inventory_loaded(items: Array)
Example
Gamdato.inventory_loaded.connect(_on_inventory)
Gamdato.get_inventory()
func _on_inventory(items: Array) -> void:
for it in items:
print("owns: %s (%s)" % [it.item_id, it.source])Use cases
- Unlock cosmetics or content the player already owns when the game starts.
- Render an inventory screen of acquired items.