fix #106: pause menu can be closed via the button
This commit is contained in:
parent
9926e60aeb
commit
b187bf241d
|
|
@ -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/")
|
||||||
|
|
|
||||||
23
src/main.gd
23
src/main.gd
|
|
@ -56,16 +56,19 @@ 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:
|
||||||
if not get_tree().paused:
|
toggle_pause_menu()
|
||||||
get_tree().paused = true
|
|
||||||
var state_machine = menu_animation["parameters/playback"]
|
func toggle_pause_menu():
|
||||||
state_machine.travel("reveal_pause_menu")
|
if not get_tree().paused:
|
||||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
get_tree().paused = true
|
||||||
else:
|
var state_machine = menu_animation["parameters/playback"]
|
||||||
get_tree().paused = false
|
state_machine.travel("reveal_pause_menu")
|
||||||
var state_machine = menu_animation["parameters/playback"]
|
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||||
state_machine.travel("start_game")
|
else:
|
||||||
Input.mouse_mode = Input.MOUSE_MODE_HIDDEN
|
get_tree().paused = false
|
||||||
|
var state_machine = menu_animation["parameters/playback"]
|
||||||
|
state_machine.travel("start_game")
|
||||||
|
Input.mouse_mode = Input.MOUSE_MODE_HIDDEN
|
||||||
|
|
||||||
func debug_youth():
|
func debug_youth():
|
||||||
get_child(1).hide()
|
get_child(1).hide()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue