From 679bba3b46ea30a329c617b3cc47645d540a261f Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 13 Apr 2023 14:58:24 -0400 Subject: Client switches to LL1 after a successful connection --- Archipelago/client.gd | 4 ++++ Archipelago/settings_screen.gd | 9 +++++++++ 2 files changed, 13 insertions(+) (limited to 'Archipelago') 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 = [] var _checked_locations = [] var _slot_data = {} +signal client_connected + func _init(): global._print("Instantiated APClient") @@ -102,6 +104,8 @@ func _on_data(): _checked_locations = message["checked_locations"] _slot_data = message["slot_data"] + emit_signal("client_connected") + elif cmd == "ConnectionRefused": global._print("Connection to AP refused") 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(): apclient_instance.name = "Archipelago" global.add_child(apclient_instance) + global.get_node("Archipelago").connect("client_connected", self, "connectionSuccessful") + # Populate textboxes with AP settings. self.get_node("Panel/server_box").text = global.get_node("Archipelago").ap_server self.get_node("Panel/player_box").text = global.get_node("Archipelago").ap_user self.get_node("Panel/password_box").text = global.get_node("Archipelago").ap_pass + + +func connectionSuccessful(): + # Switch to LL1 + Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) + global.map = "level1" + var _discard = get_tree().change_scene("res://scenes/load_screen.tscn") -- cgit 1.4.1