diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-04-12 16:22:38 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-04-12 16:22:38 -0400 |
commit | 437438ad6aed07a2c1d149a72759f7f2a3277ea6 (patch) | |
tree | 82534db3d69ad8c50e9f47fff52134cd945213f4 /Archipelago/settings_buttons.gd | |
parent | 563382d459ce18b6df4e5cf9161bc47d942d9276 (diff) | |
download | lingo-archipelago-437438ad6aed07a2c1d149a72759f7f2a3277ea6.tar.gz lingo-archipelago-437438ad6aed07a2c1d149a72759f7f2a3277ea6.tar.bz2 lingo-archipelago-437438ad6aed07a2c1d149a72759f7f2a3277ea6.zip |
Created global client object
Diffstat (limited to 'Archipelago/settings_buttons.gd')
-rw-r--r-- | Archipelago/settings_buttons.gd | 24 |
1 files changed, 5 insertions, 19 deletions
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(): | |||
6 | 6 | ||
7 | 7 | ||
8 | func _connect_pressed(): | 8 | func _connect_pressed(): |
9 | # Save the AP settings to disk. | 9 | var apclient = global.get_node("Archipelago") |
10 | var dir = Directory.new() | 10 | apclient.ap_server = self.get_parent().get_node("server_box").text |
11 | var path = "user://settings" | 11 | apclient.ap_user = self.get_parent().get_node("player_box").text |
12 | if dir.dir_exists(path): | 12 | apclient.ap_pass = self.get_parent().get_node("password_box").text |
13 | pass | 13 | apclient.saveSettings() |
14 | else: | ||
15 | dir.make_dir(path) | ||
16 | |||
17 | var file = File.new() | ||
18 | file.open("user://settings/archipelago", File.WRITE) | ||
19 | |||
20 | var data = [ | ||
21 | self.get_parent().get_node("server_box").text, | ||
22 | self.get_parent().get_node("player_box").text, | ||
23 | self.get_parent().get_node("password_box").text | ||
24 | ] | ||
25 | |||
26 | file.store_var(data, true) | ||
27 | file.close() | ||
28 | 14 | ||
29 | 15 | ||
30 | func _back_pressed(): | 16 | func _back_pressed(): |