diff options
Diffstat (limited to 'Archipelago/settings_screen.gd')
-rw-r--r-- | Archipelago/settings_screen.gd | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 91f233d..3740751 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd | |||
@@ -6,16 +6,14 @@ func _ready(): | |||
6 | get_tree().get_root().set_disable_input(false) | 6 | get_tree().get_root().set_disable_input(false) |
7 | Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) | 7 | Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) |
8 | 8 | ||
9 | # Read AP settings from file, if there are any | 9 | # Create the global AP client, if it doesn't already exist. |
10 | var file = File.new() | 10 | if not global.has_node("Archipelago"): |
11 | if file.file_exists("user://settings/archipelago"): | 11 | var apclient = ResourceLoader.load("user://maps/Archipelago/client.gd") |
12 | file.open("user://settings/archipelago", File.READ) | 12 | var apclient_instance = apclient.new() |
13 | var data = file.get_var(true) | 13 | apclient_instance.name = "Archipelago" |
14 | file.close() | 14 | global.add_child(apclient_instance) |
15 | 15 | ||
16 | if data.size() > 0: | 16 | # Populate textboxes with AP settings. |
17 | self.get_node("Panel/server_box").text = data[0] | 17 | self.get_node("Panel/server_box").text = global.get_node("Archipelago").ap_server |
18 | if data.size() > 1: | 18 | self.get_node("Panel/player_box").text = global.get_node("Archipelago").ap_user |
19 | self.get_node("Panel/player_box").text = data[1] | 19 | self.get_node("Panel/password_box").text = global.get_node("Archipelago").ap_pass |
20 | if data.size() > 2: | ||
21 | self.get_node("Panel/password_box").text = data[2] | ||