fix: add slot to grid before calling set_item so @onready nodes exist

This commit is contained in:
2026-04-26 22:21:54 -07:00
parent 61a9649ec9
commit 07e73ef741

View File

@@ -85,12 +85,12 @@ func _refresh_grid() -> void:
var slot_scene = load("res://inventory/inventory_overlay/InventorySlot.tscn")
var slot: InventorySlot = slot_scene.instantiate()
grid.add_child(slot)
slot.set_item(def)
slot.clicked.connect(_on_slot_clicked)
slot.right_clicked.connect(_on_slot_right_clicked)
slot.hovered.connect(_on_slot_hovered)
slot.unhovered.connect(_on_slot_unhovered)
grid.add_child(slot)
grid.columns = SLOTS_PER_ROW