diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-04-20 19:58:46 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-04-20 19:58:46 -0400 |
commit | cc45280174e9c52eb83d85ae9fb06149dfb17f66 (patch) | |
tree | a43e3df6c715d4d600af3b8827b78c2a8d9ff9c2 /Archipelago/settings_screen.gd | |
parent | 6abbf98ea15d80a0870d4b14fa5707a7992ab485 (diff) | |
download | lingo-archipelago-cc45280174e9c52eb83d85ae9fb06149dfb17f66.tar.gz lingo-archipelago-cc45280174e9c52eb83d85ae9fb06149dfb17f66.tar.bz2 lingo-archipelago-cc45280174e9c52eb83d85ae9fb06149dfb17f66.zip |
Show error message if failure to connect
Diffstat (limited to 'Archipelago/settings_screen.gd')
-rw-r--r-- | Archipelago/settings_screen.gd | 9 |
1 files changed, 9 insertions, 0 deletions
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(): | |||
26 | installScriptExtension("user://maps/Archipelago/panelEnd.gd") | 26 | installScriptExtension("user://maps/Archipelago/panelEnd.gd") |
27 | 27 | ||
28 | global.get_node("Archipelago").connect("client_connected", self, "connectionSuccessful") | 28 | global.get_node("Archipelago").connect("client_connected", self, "connectionSuccessful") |
29 | global.get_node("Archipelago").connect("could_not_connect", self, "connectionUnsuccessful") | ||
29 | 30 | ||
30 | # Populate textboxes with AP settings. | 31 | # Populate textboxes with AP settings. |
31 | self.get_node("Panel/server_box").text = global.get_node("Archipelago").ap_server | 32 | self.get_node("Panel/server_box").text = global.get_node("Archipelago").ap_server |
@@ -62,3 +63,11 @@ func connectionSuccessful(): | |||
62 | global.map = "level1" | 63 | global.map = "level1" |
63 | global.save_file = apclient.getSaveFileName() | 64 | global.save_file = apclient.getSaveFileName() |
64 | var _discard = get_tree().change_scene("res://scenes/load_screen.tscn") | 65 | var _discard = get_tree().change_scene("res://scenes/load_screen.tscn") |
66 | |||
67 | |||
68 | func connectionUnsuccessful(error_message): | ||
69 | var popup = self.get_node("Panel/AcceptDialog") | ||
70 | popup.window_title = "Could not connect to Archipelago" | ||
71 | popup.dialog_text = error_message | ||
72 | popup.popup_exclusive = true | ||
73 | popup.popup_centered() | ||