fix: add slot to grid before calling set_item so @onready nodes exist
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user