diff options
| author | Sophia Pearson <codergal89@gmail.com> | 2022-05-27 23:58:56 +0200 |
|---|---|---|
| committer | Sophia Pearson <codergal89@gmail.com> | 2022-05-27 23:58:56 +0200 |
| commit | 17e64ee8bd296cf003e5e71ff24a929b5974ad5b (patch) | |
| tree | d4d615b1f28681c448a246ce1faf6034a2d57f29 | |
| parent | 852f68409f5b6ac56a5f4b006002de755c5dd71c (diff) | |
| download | texty-17e64ee8bd296cf003e5e71ff24a929b5974ad5b.tar.xz texty-17e64ee8bd296cf003e5e71ff24a929b5974ad5b.zip | |
texty: handle quit game signal
| -rw-r--r-- | Scenes/Texty.tscn | 2 | ||||
| -rw-r--r-- | Scripts/Texty.cs | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Scenes/Texty.tscn b/Scenes/Texty.tscn index 7b46cf4..ae49f97 100644 --- a/Scenes/Texty.tscn +++ b/Scenes/Texty.tscn @@ -11,3 +11,5 @@ script = ExtResource( 3 ) visible = false [node name="StartMenu" parent="." instance=ExtResource( 2 )] + +[connection signal="QuitGame" from="StartMenu" to="." method="OnQuitGame"] diff --git a/Scripts/Texty.cs b/Scripts/Texty.cs index 8497f29..0a72c70 100644 --- a/Scripts/Texty.cs +++ b/Scripts/Texty.cs @@ -14,6 +14,11 @@ namespace Texty.Scripts StartMenu = GetNode<StartMenu>(nameof(StartMenu)); } + public void OnQuitGame() + { + GetTree().Notification(MainLoop.NotificationWmQuitRequest); + } + } } |
