about summary refs log tree commit diff stats
path: root/Archipelago/settings_screen.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-04-12 16:22:38 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-04-12 16:22:38 -0400
commit437438ad6aed07a2c1d149a72759f7f2a3277ea6 (patch)
tree82534db3d69ad8c50e9f47fff52134cd945213f4 /Archipelago/settings_screen.gd
parent563382d459ce18b6df4e5cf9161bc47d942d9276 (diff)
downloadlingo-archipelago-437438ad6aed07a2c1d149a72759f7f2a3277ea6.tar.gz
lingo-archipelago-437438ad6aed07a2c1d149a72759f7f2a3277ea6.tar.bz2
lingo-archipelago-437438ad6aed07a2c1d149a72759f7f2a3277ea6.zip
Created global client object
Diffstat (limited to 'Archipelago/settings_screen.gd')
-rw-r--r--Archipelago/settings_screen.gd22
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]