From cc45280174e9c52eb83d85ae9fb06149dfb17f66 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 20 Apr 2023 19:58:46 -0400 Subject: Show error message if failure to connect --- Archipelago/settings_screen.gd | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Archipelago/settings_screen.gd') diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 9c4d59a..0eb68cf 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd @@ -26,6 +26,7 @@ func _ready(): installScriptExtension("user://maps/Archipelago/panelEnd.gd") global.get_node("Archipelago").connect("client_connected", self, "connectionSuccessful") + global.get_node("Archipelago").connect("could_not_connect", self, "connectionUnsuccessful") # Populate textboxes with AP settings. self.get_node("Panel/server_box").text = global.get_node("Archipelago").ap_server @@ -62,3 +63,11 @@ func connectionSuccessful(): global.map = "level1" global.save_file = apclient.getSaveFileName() var _discard = get_tree().change_scene("res://scenes/load_screen.tscn") + + +func connectionUnsuccessful(error_message): + var popup = self.get_node("Panel/AcceptDialog") + popup.window_title = "Could not connect to Archipelago" + popup.dialog_text = error_message + popup.popup_exclusive = true + popup.popup_centered() -- cgit 1.4.1