about summary refs log tree commit diff stats
path: root/Archipelago/settings_screen.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-29 13:34:53 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-29 13:34:53 -0400
commiteff3dff1142876b70e0336f03b4efb12db4e2bba (patch)
treed0f19c16094706e9c3a6d4b59d9f4ee44e535ad4 /Archipelago/settings_screen.gd
parent8b97ed0755c8d950f5cc8f9a957636982f33f012 (diff)
parent2b0fcdde3144213676324163d721150a8641d610 (diff)
downloadlingo-archipelago-eff3dff1142876b70e0336f03b4efb12db4e2bba.tar.gz
lingo-archipelago-eff3dff1142876b70e0336f03b4efb12db4e2bba.tar.bz2
lingo-archipelago-eff3dff1142876b70e0336f03b4efb12db4e2bba.zip
Merge branch 'main' into color-hallways
Diffstat (limited to 'Archipelago/settings_screen.gd')
-rw-r--r--Archipelago/settings_screen.gd35
1 files changed, 35 insertions, 0 deletions
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index de64214..79fdcc3 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd
@@ -30,6 +30,8 @@ func _ready():
30 apclient_instance.SCRIPT_mypainting = load("user://maps/Archipelago/mypainting.gd") 30 apclient_instance.SCRIPT_mypainting = load("user://maps/Archipelago/mypainting.gd")
31 apclient_instance.SCRIPT_notifier = load("user://maps/Archipelago/notifier.gd") 31 apclient_instance.SCRIPT_notifier = load("user://maps/Archipelago/notifier.gd")
32 apclient_instance.SCRIPT_panel = load("user://maps/Archipelago/panel.gd") 32 apclient_instance.SCRIPT_panel = load("user://maps/Archipelago/panel.gd")
33 var pilg_term = load("user://maps/Archipelago/pilgrimage_terminator.gd")
34 apclient_instance.SCRIPT_pilgrimage_terminator = pilg_term
33 apclient_instance.SCRIPT_uuid = load("user://maps/Archipelago/vendor/uuid.gd") 35 apclient_instance.SCRIPT_uuid = load("user://maps/Archipelago/vendor/uuid.gd")
34 36
35 var apdata = ResourceLoader.load("user://maps/Archipelago/gamedata.gd") 37 var apdata = ResourceLoader.load("user://maps/Archipelago/gamedata.gd")
@@ -45,6 +47,7 @@ func _ready():
45 # Let's also inject any scripts we need to inject now. 47 # Let's also inject any scripts we need to inject now.
46 installScriptExtension(apclient_instance.SCRIPT_doorControl) 48 installScriptExtension(apclient_instance.SCRIPT_doorControl)
47 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd")) 49 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd"))
50 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting.gd"))
48 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_eye.gd")) 51 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_eye.gd"))
49 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_scenery.gd")) 52 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_scenery.gd"))
50 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelLevelSwitch.gd")) 53 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelLevelSwitch.gd"))
@@ -52,6 +55,7 @@ func _ready():
52 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd")) 55 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelInput.gd"))
53 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd")) 56 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/pause_menu.gd"))
54 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd")) 57 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/player.gd"))
58 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/teleport.gd"))
55 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd")) 59 installScriptExtension(ResourceLoader.load("user://maps/Archipelago/worldTransporter.gd"))
56 60
57 var apclient = global.get_node("Archipelago") 61 var apclient = global.get_node("Archipelago")
@@ -67,6 +71,19 @@ func _ready():
67 self.get_node("Panel/multiplayer_box").pressed = apclient.enable_multiplayer 71 self.get_node("Panel/multiplayer_box").pressed = apclient.enable_multiplayer
68 self.get_node("Panel/position_box").pressed = apclient.track_player 72 self.get_node("Panel/position_box").pressed = apclient.track_player
69 73
74 var history_box = get_node("Panel/connection_history")
75 if apclient.connection_history.empty():
76 history_box.disabled = true
77 else:
78 history_box.disabled = false
79
80 var i = 0
81 for details in apclient.connection_history:
82 history_box.get_popup().add_item("%s (%s)" % [details[1], details[0]], i)
83 i += 1
84
85 history_box.get_popup().connect("id_pressed", self, "historySelected")
86
70 # Show client version. 87 # Show client version.
71 self.get_node("Panel/title").text = "ARCHIPELAGO (%s)" % apclient.my_version 88 self.get_node("Panel/title").text = "ARCHIPELAGO (%s)" % apclient.my_version
72 89
@@ -109,6 +126,15 @@ func connectionStatus(message):
109func connectionSuccessful(): 126func connectionSuccessful():
110 var apclient = global.get_node("Archipelago") 127 var apclient = global.get_node("Archipelago")
111 128
129 # Save connection details
130 var connection_details = [apclient.ap_server, apclient.ap_user, apclient.ap_pass]
131 if apclient.connection_history.has(connection_details):
132 apclient.connection_history.erase(connection_details)
133 apclient.connection_history.push_front(connection_details)
134 if apclient.connection_history.size() > 10:
135 apclient.connection_history.resize(10)
136 apclient.saveSettings()
137
112 # Switch to LL1 138 # Switch to LL1
113 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 139 Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
114 global.save_file = apclient.getSaveFileName() 140 global.save_file = apclient.getSaveFileName()
@@ -130,3 +156,12 @@ func connectionUnsuccessful(error_message):
130 popup.popup_exclusive = true 156 popup.popup_exclusive = true
131 popup.get_ok().visible = true 157 popup.get_ok().visible = true
132 popup.popup_centered() 158 popup.popup_centered()
159
160
161func historySelected(index):
162 var apclient = global.get_node("Archipelago")
163 var details = apclient.connection_history[index]
164
165 self.get_node("Panel/server_box").text = details[0]
166 self.get_node("Panel/player_box").text = details[1]
167 self.get_node("Panel/password_box").text = details[2]