about summary refs log tree commit diff stats
path: root/Archipelago/settings_buttons.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago/settings_buttons.gd')
-rw-r--r--Archipelago/settings_buttons.gd31
1 files changed, 31 insertions, 0 deletions
diff --git a/Archipelago/settings_buttons.gd b/Archipelago/settings_buttons.gd new file mode 100644 index 0000000..5b4d837 --- /dev/null +++ b/Archipelago/settings_buttons.gd
@@ -0,0 +1,31 @@
1extends Button
2
3
4func _ready():
5 pass
6
7
8func _connect_pressed():
9 # Save the AP settings to disk.
10 var dir = Directory.new()
11 var path = "user://settings"
12 if dir.dir_exists(path):
13 pass
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
29
30func _back_pressed():
31 fader._fade_start("main_menu")