17 lines
363 B
GDScript
17 lines
363 B
GDScript
class_name UI
|
|
extends Node
|
|
|
|
@export var player: Player
|
|
|
|
@onready var inventory_ui: InventoryUI = %Inventory
|
|
|
|
func _ready():
|
|
player.entity_inventory.inventory.changed.connect(_on_player_inventory_changed)
|
|
update_inventory_ui()
|
|
|
|
func _on_player_inventory_changed():
|
|
update_inventory_ui()
|
|
|
|
func update_inventory_ui():
|
|
inventory_ui.update(player.get_inventory())
|