From 40e16bba923d7cc3c3a3e55ba2a43e5f861862e2 Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Sun, 27 Nov 2022 20:11:34 -0700 Subject: [PATCH] edit end screen --- godot/screens/EndScreen.tscn | 6 +++++- godot/screens/death.gd | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/godot/screens/EndScreen.tscn b/godot/screens/EndScreen.tscn index bcead0b..38d8234 100644 --- a/godot/screens/EndScreen.tscn +++ b/godot/screens/EndScreen.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://assets/audio/human-impact-on-ground-6982.mp3" type="AudioStream" id=1] [ext_resource path="res://assets/Background_space.png" type="Texture" id=2] [ext_resource path="res://assets/audio/RandomSong.wav" type="AudioStream" id=3] [ext_resource path="res://screens/death.gd" type="Script" id=4] [ext_resource path="res://assets/ui_theme.tres" type="Theme" id=5] +[ext_resource path="res://effects/grainy_shader.tscn" type="PackedScene" id=6] [node name="EndScreen" type="Control"] anchor_right = 1.0 @@ -51,6 +52,7 @@ focus_neighbour_bottom = NodePath("../PlayButton") text = "Quit" [node name="Blackout" type="CanvasLayer" parent="."] +visible = false [node name="BlackBox" type="ColorRect" parent="Blackout"] anchor_right = 1.0 @@ -68,6 +70,8 @@ autoplay = true [node name="TitleScreenMusic" type="AudioStreamPlayer" parent="."] stream = ExtResource( 3 ) +[node name="shader" parent="." instance=ExtResource( 6 )] + [connection signal="pressed" from="Menu/RetryButton" to="." method="_on_RetryButton_pressed"] [connection signal="pressed" from="Menu/MenuButton" to="." method="_on_MenuButton_pressed"] [connection signal="pressed" from="Menu/QuitButton" to="." method="_on_QuitButton_pressed"] diff --git a/godot/screens/death.gd b/godot/screens/death.gd index 33b6cf0..181fdd7 100644 --- a/godot/screens/death.gd +++ b/godot/screens/death.gd @@ -1,17 +1,26 @@ extends Control +func _ready(): + $Blackout.visible = true + $Menu.visible = false func _on_RetryButton_pressed(): pass # Replace with function body. - func _on_MenuButton_pressed(): var _err = get_tree().change_scene("res://screens/title.tscn") - func _on_QuitButton_pressed(): get_tree().quit() func _on_BlackoutTimer_timeout(): - pass # Replace with function body. + var dialog = Dialogic.start("end") + dialog.connect("tree_exited", self, "_on_dialogue_done") + add_child(dialog) + +func _on_dialogue_done(): + $Blackout.visible = false + $Menu.visible = true + $TitleScreenMusic.play() + $Menu/RetryButton.grab_focus()