From 0fcd3a848ae1a3be8e4d2aab9b85e27d8136a8a1 Mon Sep 17 00:00:00 2001
From: Star Rauchenberger <fefferburbia@gmail.com>
Date: Fri, 21 Apr 2023 11:11:59 -0400
Subject: Client now shows a version number

---
 Archipelago/client.gd          |  1 +
 Archipelago/load.gd            |  2 +-
 Archipelago/settings_screen.gd | 18 +++++++++++-------
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/Archipelago/client.gd b/Archipelago/client.gd
index f805577..dba8227 100644
--- a/Archipelago/client.gd
+++ b/Archipelago/client.gd
@@ -4,6 +4,7 @@ var ap_server = ""
 var ap_user = ""
 var ap_pass = ""
 
+const my_version = "0.1.0"
 const ap_version = {"major": 0, "minor": 4, "build": 0, "class": "Version"}
 const orange_tower = ["Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh"]
 const color_items = [
diff --git a/Archipelago/load.gd b/Archipelago/load.gd
index 6b65b0e..5403adb 100644
--- a/Archipelago/load.gd
+++ b/Archipelago/load.gd
@@ -118,7 +118,7 @@ func _load():
 	# Handle our other static panels after panel randomization, so that the old
 	# values can enter the pool, if necessary.
 	set_static_panel("Entry Room/Panel_hi_hi", "hi")
-	set_static_panel("Entry Room/Panel_write_write", "seed")
+	set_static_panel("Entry Room/Panel_write_write", apclient.my_version)
 	set_static_panel("Entry Room/Panel_same_same", str(apclient._slot_seed))
 	set_static_panel("Entry Room/Panel_type_type", "victory")
 
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