You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
539 B
26 lines
539 B
class_name EscapeMenu |
|
extends Control |
|
|
|
@export var return_button : Button |
|
|
|
func _unhandled_input(event: InputEvent) -> void: |
|
if event.is_action_pressed("ui_cancel"): |
|
toggle() |
|
|
|
func toggle() -> void: |
|
if visible: close() |
|
else: open() |
|
func open() -> void: |
|
if visible: return |
|
# get_tree().paused = true |
|
return_button.grab_focus() |
|
visible = true |
|
func close() -> void: |
|
if not visible: return |
|
# get_tree().paused = false |
|
visible = false |
|
|
|
func _on_quit_pressed() -> void: |
|
get_tree().quit() |
|
func _on_return_pressed() -> void: |
|
close()
|
|
|