about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-04-13 14:58:24 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-04-13 14:58:24 -0400
commit679bba3b46ea30a329c617b3cc47645d540a261f (patch)
tree9a5912f3443ef9dd6e48d2d2088135f29592cd67
parentb6b24b10c6fb056bfa297c6f3a6f29a9991f9fa1 (diff)
downloadlingo-archipelago-679bba3b46ea30a329c617b3cc47645d540a261f.tar.gz
lingo-archipelago-679bba3b46ea30a329c617b3cc47645d540a261f.tar.bz2
lingo-archipelago-679bba3b46ea30a329c617b3cc47645d540a261f.zip
Client switches to LL1 after a successful connection
-rw-r--r--Archipelago/client.gd4
-rw-r--r--Archipelago/settings_screen.gd9
2 files changed, 13 insertions, 0 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 62f4d71..74fe6e9 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -23,6 +23,8 @@ var _players = []
23var _checked_locations = [] 23var _checked_locations = []
24var _slot_data = {} 24var _slot_data = {}
25 25
26signal client_connected
27
26 28
27func _init(): 29func _init():
28 global._print("Instantiated APClient") 30 global._print("Instantiated APClient")
@@ -102,6 +104,8 @@ func _on_data():
102 _checked_locations = message["checked_locations"] 104 _checked_locations = message["checked_locations"]
103 _slot_data = message["slot_data"] 105 _slot_data = message["slot_data"]
104 106
107 emit_signal("client_connected")
108
105 elif cmd == "ConnectionRefused": 109 elif cmd == "ConnectionRefused":
106 global._print("Connection to AP refused") 110 global._print("Connection to AP refused")
107 global._print(message) 111 global._print(message)
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 3740751..0854a8b 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd
@@ -13,7 +13,16 @@ func _ready():
13 apclient_instance.name = "Archipelago" 13 apclient_instance.name = "Archipelago"
14 global.add_child(apclient_instance) 14 global.add_child(apclient_instance)
15 15
16 global.get_node("Archipelago").connect("client_connected", self, "connectionSuccessful")
17
16 # Populate textboxes with AP settings. 18 # Populate textboxes with AP settings.
17 self.get_node("Panel/server_box").text = global.get_node("Archipelago").ap_server 19 self.get_node("Panel/server_box").text = global.get_node("Archipelago").ap_server
18 self.get_node("Panel/player_box").text = global.get_node("Archipelago").ap_user 20 self.get_node("Panel/player_box").text = global.get_node("Archipelago").ap_user
19 self.get_node("Panel/password_box").text = global.get_node("Archipelago").ap_pass 21 self.get_node("Panel/password_box").text = global.get_node("Archipelago").ap_pass
22
23
24func connectionSuccessful():
25 # Switch to LL1
26 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
27 global.map = "level1"
28 var _discard = get_tree().change_scene("res://scenes/load_screen.tscn")