extends CanvasLayer

func _ready():
	hide() 

func _unhandled_input(event):
	if event.is_action_pressed("ui_cancel"):
		if $OptionsMenu.visible:
			return  
		toggle_pause()

func toggle_pause():
	var paused = not get_tree().paused
	get_tree().paused = paused
	visible = paused

func _on_continue_button_pressed() -> void:
	toggle_pause()

func _on_quit_button_pressed() -> void:
	get_tree().quit()


func _on_options_button_pressed() -> void:
	$VBoxContainer.hide()
	$OptionsMenu.show()
