2026-08-13 13:28:13 +02:00
|
|
|
class_name InventoryComponent extends Node
|
|
|
|
|
|
|
|
|
|
var toggled: bool = false
|
|
|
|
|
@onready var inventory_menu = UiManager.inventory_menu
|
|
|
|
|
|
|
|
|
|
signal toggle(toggle: bool)
|
|
|
|
|
|
|
|
|
|
func _process(delta: float) -> void:
|
2026-08-13 17:06:15 +02:00
|
|
|
if not Console.toggled:
|
|
|
|
|
if Input.is_action_just_pressed("open_inventory"):
|
|
|
|
|
if toggled:
|
|
|
|
|
print("toggle off")
|
|
|
|
|
toggle.emit(false)
|
|
|
|
|
else:
|
|
|
|
|
print("toggle on")
|
|
|
|
|
toggle.emit(true)
|
|
|
|
|
toggled = !toggled
|
|
|
|
|
|
|
|
|
|
#func _process(delta: float) -> void:
|
|
|
|
|
#if Input.is_action_just_pressed("open_inventory"):
|
|
|
|
|
#if toggled:
|
|
|
|
|
#print("toggle off")
|
|
|
|
|
#UiManager.toggle_inventory_menu(false)
|
|
|
|
|
#toggle.emit(false)
|
|
|
|
|
#else:
|
|
|
|
|
#print("toggle on")
|
|
|
|
|
#UiManager.toggle_inventory_menu(true)
|
|
|
|
|
#toggle.emit(true)
|
|
|
|
|
#toggled = !toggled
|