about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-04-20 23:14:53 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-04-20 23:14:53 -0400
commita7c26b74bbdafc93f8a2441f692647a7e55a47ed (patch)
tree625a3fcf84cffd3965b9bb88f258f476df383298
parent86a87b882be20825af21bd09225aaa35ca793777 (diff)
downloadlingo-archipelago-a7c26b74bbdafc93f8a2441f692647a7e55a47ed.tar.gz
lingo-archipelago-a7c26b74bbdafc93f8a2441f692647a7e55a47ed.tar.bz2
lingo-archipelago-a7c26b74bbdafc93f8a2441f692647a7e55a47ed.zip
Returning to main menu now disconnects
-rw-r--r--Archipelago/client.gd14
-rw-r--r--Archipelago/pause_menu.gd8
-rw-r--r--Archipelago/settings_screen.gd1
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
101func _errored(): 101func _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
107func _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
112func _closed(): 117func _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 @@
1extends "res://scripts/pause_menu.gd"
2
3
4func _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")