From 437438ad6aed07a2c1d149a72759f7f2a3277ea6 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 12 Apr 2023 16:22:38 -0400 Subject: Created global client object --- Archipelago/settings_buttons.gd | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'Archipelago/settings_buttons.gd') diff --git a/Archipelago/settings_buttons.gd b/Archipelago/settings_buttons.gd index 5b4d837..1ab3788 100644 --- a/Archipelago/settings_buttons.gd +++ b/Archipelago/settings_buttons.gd @@ -6,25 +6,11 @@ func _ready(): func _connect_pressed(): - # Save the AP settings to disk. - var dir = Directory.new() - var path = "user://settings" - if dir.dir_exists(path): - pass - else: - dir.make_dir(path) - - var file = File.new() - file.open("user://settings/archipelago", File.WRITE) - - var data = [ - self.get_parent().get_node("server_box").text, - self.get_parent().get_node("player_box").text, - self.get_parent().get_node("password_box").text - ] - - file.store_var(data, true) - file.close() + var apclient = global.get_node("Archipelago") + apclient.ap_server = self.get_parent().get_node("server_box").text + apclient.ap_user = self.get_parent().get_node("player_box").text + apclient.ap_pass = self.get_parent().get_node("password_box").text + apclient.saveSettings() func _back_pressed(): -- cgit 1.4.1