2020-09-27 21:29:46 +00:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
signal dismissed
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
$CanvasLayer/VBoxContainer/ResumeBtn.grab_focus()
|
2020-09-28 21:18:07 +00:00
|
|
|
AudioManager.set_volume()
|
|
|
|
|
2020-09-27 21:29:46 +00:00
|
|
|
func dismiss()->void:
|
|
|
|
_on_ResumeBtn_pressed()
|
|
|
|
|
2020-09-28 02:37:03 +00:00
|
|
|
func _input(event: InputEvent) -> void:
|
|
|
|
if Input.is_action_just_pressed("pause"):
|
|
|
|
_on_ResumeBtn_pressed()
|
2020-09-28 21:18:07 +00:00
|
|
|
return
|
|
|
|
if Input.is_action_just_pressed("ui_up") or Input.is_action_just_pressed("ui_down"):
|
|
|
|
AudioManager.play_sfx(AudioManager.Sfx.UI_MOVE)
|
2020-09-27 21:29:46 +00:00
|
|
|
|
|
|
|
func _on_ResumeBtn_pressed() -> void:
|
|
|
|
$AnimationPlayer.play_backwards("fade")
|
2020-09-28 21:18:07 +00:00
|
|
|
AudioManager.set_volume(.2, AudioManager._DESIRED_VOLUME)
|
2020-09-27 21:29:46 +00:00
|
|
|
yield($AnimationPlayer, "animation_finished");
|
|
|
|
emit_signal("dismissed")
|
|
|
|
queue_free()
|
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
|
|
|
|
func _on_ExitToMainMenuBtn_pressed() -> void:
|
|
|
|
$AnimationPlayer.play_backwards("fade")
|
|
|
|
yield($AnimationPlayer, "animation_finished");
|
2020-09-28 02:37:03 +00:00
|
|
|
emit_signal("dismissed")
|
2020-09-28 21:18:07 +00:00
|
|
|
AudioManager.play_music(AudioManager.Music.Intro, .2)
|
2020-09-29 01:36:57 +00:00
|
|
|
GameState.go_to_main_menu()
|
2020-09-27 21:29:46 +00:00
|
|
|
queue_free()
|
2020-09-28 02:37:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_NewGameBtn_pressed() -> void:
|
|
|
|
$AnimationPlayer.play_backwards("fade")
|
|
|
|
yield($AnimationPlayer, "animation_finished");
|
|
|
|
emit_signal("dismissed")
|
2020-09-29 01:36:57 +00:00
|
|
|
GameState.start_new_game()
|
2020-09-28 02:37:03 +00:00
|
|
|
pass # Replace with function body.
|
2020-09-28 21:18:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_btn_focus_entered() -> void:
|
|
|
|
|
|
|
|
pass # Replace with function body.
|