fix #106: pause menu can be closed via the button
This commit is contained in:
parent
f132d448c8
commit
c1059072fc
|
|
@ -9,7 +9,7 @@ class_name PauseManu extends PanelContainer
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
resume_button.pressed.connect(_process)
|
resume_button.pressed.connect(owner.toggle_pause_menu)
|
||||||
to_menu_button.pressed.connect(_process)
|
to_menu_button.pressed.connect(_process)
|
||||||
to_desktop_button.pressed.connect(func(): get_tree().quit())
|
to_desktop_button.pressed.connect(func(): get_tree().quit())
|
||||||
to_settings_button.pressed.connect(_process)
|
to_settings_button.pressed.connect(_process)
|
||||||
|
|
@ -21,5 +21,6 @@ func _ready() -> void:
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
func _on_help_pressed():
|
func _on_help_pressed():
|
||||||
OS.shell_open("https://findahelpline.com/")
|
OS.shell_open("https://findahelpline.com/")
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@ func _process(delta: float) -> void:
|
||||||
_return_to_menu()
|
_return_to_menu()
|
||||||
$"Messe-Menue".show()
|
$"Messe-Menue".show()
|
||||||
if Input.is_action_just_pressed("ui_menu") and in_game:
|
if Input.is_action_just_pressed("ui_menu") and in_game:
|
||||||
|
toggle_pause_menu()
|
||||||
|
|
||||||
|
func toggle_pause_menu():
|
||||||
if not get_tree().paused:
|
if not get_tree().paused:
|
||||||
get_tree().paused = true
|
get_tree().paused = true
|
||||||
var state_machine = menu_animation["parameters/playback"]
|
var state_machine = menu_animation["parameters/playback"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue