gfolf2/src/ui/menus/pause_menu/pause_menu.gd

38 lines
634 B
GDScript3
Raw Normal View History

2024-11-19 15:44:47 -07:00
extends Control
## Menu shown in-game when the user presses pause.
@onready var menu_list: VBoxContainer = %MenuList
func _ready() -> void:
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func _exit_tree() -> void:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _unhandled_key_input(event: InputEvent) -> void:
if event.is_action_pressed("pause"):
resume()
func _unhide() -> void:
menu_list.show()
func _hide() -> void:
menu_list.hide()
func resume() -> void:
queue_free()
func settings() -> void:
pass # TODO
func quit() -> void:
get_tree().root.propagate_notification(NOTIFICATION_WM_CLOSE_REQUEST)