about summary refs log tree commit diff stats
path: root/Archipelago/settings_buttons.gd
blob: 5b4d8377dac7759ac9763a10ad2f5b81479305a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
extends Button


func _ready():
	pass


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()


func _back_pressed():
	fader._fade_start("main_menu")