From 0fcd3a848ae1a3be8e4d2aab9b85e27d8136a8a1 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 21 Apr 2023 11:11:59 -0400 Subject: Client now shows a version number --- Archipelago/settings_screen.gd | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'Archipelago/settings_screen.gd') diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 6216dd7..7da2f43 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd @@ -8,8 +8,8 @@ func _ready(): # Create the global AP client, if it doesn't already exist. if not global.has_node("Archipelago"): - var apclient = ResourceLoader.load("user://maps/Archipelago/client.gd") - var apclient_instance = apclient.new() + var apclient_script = ResourceLoader.load("user://maps/Archipelago/client.gd") + var apclient_instance = apclient_script.new() apclient_instance.name = "Archipelago" global.add_child(apclient_instance) @@ -26,13 +26,17 @@ func _ready(): installScriptExtension("user://maps/Archipelago/panelEnd.gd") installScriptExtension("user://maps/Archipelago/pause_menu.gd") - global.get_node("Archipelago").connect("client_connected", self, "connectionSuccessful") - global.get_node("Archipelago").connect("could_not_connect", self, "connectionUnsuccessful") + var apclient = global.get_node("Archipelago") + apclient.connect("client_connected", self, "connectionSuccessful") + apclient.connect("could_not_connect", self, "connectionUnsuccessful") # 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 + self.get_node("Panel/server_box").text = apclient.ap_server + self.get_node("Panel/player_box").text = apclient.ap_user + self.get_node("Panel/password_box").text = apclient.ap_pass + + # Show client version. + self.get_node("Panel/title").text = "ARCHIPELAGO (%s)" % apclient.my_version # Adapted from https://gitlab.com/Delta-V-Modding/Mods/-/blob/main/game/ModLoader.gd -- cgit 1.4.1