diff options
-rw-r--r-- | Archipelago/client.gd | 14 | ||||
-rw-r--r-- | Archipelago/pause_menu.gd | 8 | ||||
-rw-r--r-- | Archipelago/settings_screen.gd | 1 |
3 files changed, 18 insertions, 5 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index bb6d0a2..f805577 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -98,10 +98,15 @@ func _ready(): | |||
98 | _client.connect("data_received", self, "_on_data") | 98 | _client.connect("data_received", self, "_on_data") |
99 | 99 | ||
100 | 100 | ||
101 | func _errored(): | 101 | func _reset_state(): |
102 | global._print("AP connection failed") | ||
103 | _should_process = false | 102 | _should_process = false |
104 | _authenticated = false | 103 | _authenticated = false |
104 | _map_loaded = false | ||
105 | |||
106 | |||
107 | func _errored(): | ||
108 | global._print("AP connection failed") | ||
109 | _reset_state() | ||
105 | 110 | ||
106 | emit_signal( | 111 | emit_signal( |
107 | "could_not_connect", | 112 | "could_not_connect", |
@@ -109,10 +114,9 @@ func _errored(): | |||
109 | ) | 114 | ) |
110 | 115 | ||
111 | 116 | ||
112 | func _closed(): | 117 | func _closed(_was_clean = true): |
113 | global._print("Connection closed") | 118 | global._print("Connection closed") |
114 | _should_process = false | 119 | _reset_state() |
115 | _authenticated = false | ||
116 | 120 | ||
117 | if not _initiated_disconnect: | 121 | if not _initiated_disconnect: |
118 | emit_signal("could_not_connect", "Disconnected from Archipelago") | 122 | emit_signal("could_not_connect", "Disconnected from Archipelago") |
diff --git a/Archipelago/pause_menu.gd b/Archipelago/pause_menu.gd new file mode 100644 index 0000000..40994d9 --- /dev/null +++ b/Archipelago/pause_menu.gd | |||
@@ -0,0 +1,8 @@ | |||
1 | extends "res://scripts/pause_menu.gd" | ||
2 | |||
3 | |||
4 | func _main_menu(): | ||
5 | var apclient = global.get_node("Archipelago") | ||
6 | apclient.disconnect_from_ap() | ||
7 | |||
8 | ._main_menu() | ||
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index b74617b..6216dd7 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd | |||
@@ -24,6 +24,7 @@ func _ready(): | |||
24 | installScriptExtension("user://maps/Archipelago/painting_eye.gd") | 24 | installScriptExtension("user://maps/Archipelago/painting_eye.gd") |
25 | installScriptExtension("user://maps/Archipelago/panelLevelSwitch.gd") | 25 | installScriptExtension("user://maps/Archipelago/panelLevelSwitch.gd") |
26 | installScriptExtension("user://maps/Archipelago/panelEnd.gd") | 26 | installScriptExtension("user://maps/Archipelago/panelEnd.gd") |
27 | installScriptExtension("user://maps/Archipelago/pause_menu.gd") | ||
27 | 28 | ||
28 | global.get_node("Archipelago").connect("client_connected", self, "connectionSuccessful") | 29 | global.get_node("Archipelago").connect("client_connected", self, "connectionSuccessful") |
29 | global.get_node("Archipelago").connect("could_not_connect", self, "connectionUnsuccessful") | 30 | global.get_node("Archipelago").connect("could_not_connect", self, "connectionUnsuccessful") |