aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-24 20:40:23 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-24 20:40:23 +0200
commitc6aff9bdd25355dd3c9b68ccc13f0cc82c2978a1 (patch)
tree70876d174347e57ece2f9143af00ecd0ef486204
parentf59a19f24371e0f33a82ca8c290c0dd1d24e0607 (diff)
downloadhurrycurry-c6aff9bdd25355dd3c9b68ccc13f0cc82c2978a1.tar
hurrycurry-c6aff9bdd25355dd3c9b68ccc13f0cc82c2978a1.tar.bz2
hurrycurry-c6aff9bdd25355dd3c9b68ccc13f0cc82c2978a1.tar.zst
instant scene change on error to avoid subsequent errors
-rw-r--r--client/game.gd2
-rw-r--r--client/menu/scene_transition.gd3
2 files changed, 4 insertions, 1 deletions
diff --git a/client/game.gd b/client/game.gd
index ad9467ca..70a3a371 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -27,7 +27,7 @@ var players := {}
func _ready():
mp.connect("connection_closed", func(reason: String):
Global.error_message = reason;
- $SceneTransition.transition_to("res://menu/error_menu.tscn")
+ $SceneTransition.instant_to("res://menu/error_menu.tscn")
)
await mp.init
diff --git a/client/menu/scene_transition.gd b/client/menu/scene_transition.gd
index 3ab7cdb6..8d9f38cf 100644
--- a/client/menu/scene_transition.gd
+++ b/client/menu/scene_transition.gd
@@ -27,6 +27,9 @@ func transition_to(path: String):
await out()
get_tree().change_scene_to_file(path)
+func instant_to(path: String):
+ get_tree().change_scene_to_file(path)
+
func quit():
await out()
get_tree().quit()