extends Control
@export var menu_scene : String = "res://Scenes/Main Menu.tscn"
@export var settings_scene : Resource
@export var default_focus : Button
func _ready():
for child in get_children():
child.visible = false
pass
func _input(event):
if (event.is_action_pressed("ui_cancel")):
if get_tree().paused: default_focus.grab_focus()
get_tree().paused = !get_tree().paused
child.visible = get_tree().paused
func _on_resume_button_pressed():
get_tree().paused = false
func _on_settings_button_pressed():
var settings_scene_instance = load(settings_scene.resource_path).instantiate()
settings_scene_instance.on_back = Callable(func(): default_focus.grab_focus())
get_tree().current_scene.add_child(settings_scene_instance)
func _on_quit_button_pressed():
get_tree().quit()
func _on_main_menu_button_pressed():
load(menu_scene)
get_tree().change_scene_to_file(menu_scene)