diff options
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(): |