From 154e61faa4674c653582dd207b2a3ff2250a10cb Mon Sep 17 00:00:00 2001 From: TechieDamien Date: Sat, 24 Jul 2021 17:54:52 +0100 Subject: [PATCH] Added compatibility for new server restart feature --- Scenes/RootNode.tscn | 22 ++++++++++++++++++++++ Scripts/RootNode.gd | 4 +++- project.godot | 3 ++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Scenes/RootNode.tscn b/Scenes/RootNode.tscn index d196750..84e3f47 100644 --- a/Scenes/RootNode.tscn +++ b/Scenes/RootNode.tscn @@ -35,4 +35,26 @@ autoplay = true bus = "Music" script = ExtResource( 4 ) +[node name="DisconnectDialog" type="PopupDialog" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -130.0 +margin_top = -30.0 +margin_right = 130.0 +margin_bottom = 30.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="DisconnectDialog"] +anchor_right = 1.0 +anchor_bottom = 1.0 +text = "Too many players disconnected +Game is cancelled" +align = 1 +valign = 1 +uppercase = true + [connection signal="finished" from="AudioStreamPlayer" to="AudioStreamPlayer" method="_on_finished"] diff --git a/Scripts/RootNode.gd b/Scripts/RootNode.gd index 4d36e5d..384a100 100644 --- a/Scripts/RootNode.gd +++ b/Scripts/RootNode.gd @@ -92,6 +92,8 @@ func exit_button_pressed(): remote func exit_requested(): switch_to_lobby() - +remote func server_exit_requested() -> void: + switch_to_lobby() + $DisconnectDialog.popup() diff --git a/project.godot b/project.godot index 86463ba..b95d796 100644 --- a/project.godot +++ b/project.godot @@ -54,7 +54,8 @@ ui_select={ } ui_cancel={ "deadzone": 0.5, -"events": [ ] +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) + ] } ui_focus_next={ "deadzone": 0.5,