extends Control

@onready var button: Button = $Button


func _ready():
	button.pressed.connect(_on_button_pressed)
	DebugManager.debug_ui_toggled.connect(_on_debug_ui_toggled)

	# Initialize with current debug UI state
	var current_state = DebugManager.is_debug_ui_visible()
	button.text = "Debug UI: " + ("ON" if current_state else "OFF")


func _on_button_pressed():
	DebugManager.toggle_debug_ui()


func _on_debug_ui_toggled(is_debug_visible: bool):
	button.text = "Debug UI: " + ("ON" if is_debug_visible else "OFF")
