From a80fefd0e99f5c0e0322c8338bc2c8c37429c9d9 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 13 Apr 2023 22:17:11 -0400 Subject: Save file name is now generated from AP data The name used on the new game screen no longer matters. --- Archipelago/client.gd | 6 ++++++ Archipelago/settings_screen.gd | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 0f121a1..bdd3905 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -18,6 +18,7 @@ const uuid_util = preload("user://maps/Archipelago/vendor/uuid.gd") # TODO: caching per MW/slot, reset between connections var _authenticated = false +var _seed = "" var _team = 0 var _slot = 0 var _players = [] @@ -90,6 +91,7 @@ func _on_data(): global._print("Received command: " + cmd) if cmd == "RoomInfo": + _seed = message["seed_name"] if message["datapackage_checksums"].has("Lingo"): if _datapackage_checksum != message["datapackage_checksums"]["Lingo"]: requestDatapackage() @@ -171,6 +173,10 @@ func saveSettings(): file.close() +func getSaveFileName(): + return "zzAP_%s_%d" % [_seed, _slot] + + func connectToServer(): var url = "ws://" + ap_server var err = _client.connect_to_url(url) diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 9624693..06bebd1 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd @@ -48,7 +48,10 @@ func installScriptExtension(childScriptPath: String): func connectionSuccessful(): + var apclient = global.get_node("Archipelago") + # Switch to LL1 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) global.map = "level1" + global.save_file = apclient.getSaveFileName() var _discard = get_tree().change_scene("res://scenes/load_screen.tscn") -- cgit 1.4.1