33 lines
817 B
GDScript
33 lines
817 B
GDScript
extends Control
|
|
@onready var settings: Control = $Settings
|
|
@onready var v_box_container: VBoxContainer = $VBoxContainer
|
|
func _ready() -> void:
|
|
visible = false
|
|
|
|
func resume():
|
|
visible = false
|
|
|
|
func pause():
|
|
$VBoxContainer/Resume.grab_focus()
|
|
visible = true
|
|
|
|
func testEsc():
|
|
if Input.is_action_just_pressed("back") and !visible:
|
|
pause()
|
|
elif Input.is_action_just_pressed("back") and visible:
|
|
resume()
|
|
|
|
func _on_resume_pressed() -> void:
|
|
resume()
|
|
|
|
func _on_options_pressed() -> void:
|
|
settings.visible = true
|
|
v_box_container.visible = false
|
|
|
|
func _on_main_menu_pressed() -> void:
|
|
get_tree().change_scene_to_file("res://scenes/main_menu.tscn")
|
|
get_parent().queue_free()
|
|
func _process(delta: float) -> void:
|
|
testEsc()
|
|
if !settings.visible and !v_box_container.visible:
|
|
v_box_container.visible = true
|