extends Button


func _ready():
	pressed.connect(_on_pressed)
	DebugManager.debug_toggled.connect(_on_debug_toggled)

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


func _on_pressed():
	DebugManager.toggle_debug()


func _on_debug_toggled(enabled: bool):
	text = "Debug: " + ("ON" if enabled else "OFF")
