fixed inventory + using Sync bindings
This commit is contained in:
@@ -21,6 +21,8 @@ extends Node
|
||||
@onready var inventory_layer: CanvasLayer = $"../InventoryLayer"
|
||||
@onready var player: PlayerController = $"../Player"
|
||||
|
||||
var inventory: OverlaidMenu = null
|
||||
|
||||
func _ready() -> void:
|
||||
toolbox_action.triggered.connect(open_toolbox)
|
||||
inventory_action.triggered.connect(open_inventory)
|
||||
@@ -37,9 +39,11 @@ func open_toolbox() -> void:
|
||||
debug_layer.call_deferred("add_child", toolbox)
|
||||
|
||||
func open_inventory() -> void:
|
||||
var inventory: Control = open_overlaid_menu(inventory_scene)
|
||||
# inventory.player = player
|
||||
inventory_layer.call_deferred("add_child", inventory)
|
||||
if inventory == null:
|
||||
inventory = open_overlaid_menu(inventory_scene)
|
||||
inventory_layer.call_deferred("add_child", inventory)
|
||||
return
|
||||
inventory.show_menu()
|
||||
|
||||
func on_player_died() -> void:
|
||||
var lost_menu: LevelLostMenu = open_overlaid_menu(lost_menu_scene)
|
||||
|
||||
Reference in New Issue
Block a user