diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-04-27 12:13:38 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-04-27 12:13:38 -0400 |
commit | 47755e9e28f9b8866d3c41866910594e2d8c979a (patch) | |
tree | 488df5471f58eb0c6a1f7f872a17aa0ebe07231e /Archipelago/settings_screen.gd | |
parent | 4302e550cde189d8bc1d111e81270ed7960ad77c (diff) | |
parent | 0c25dc87e5ad9c8c8c2ff0ef5ac6502b166bc405 (diff) | |
download | lingo-archipelago-47755e9e28f9b8866d3c41866910594e2d8c979a.tar.gz lingo-archipelago-47755e9e28f9b8866d3c41866910594e2d8c979a.tar.bz2 lingo-archipelago-47755e9e28f9b8866d3c41866910594e2d8c979a.zip |
Merge branch 'main' into panels
Diffstat (limited to 'Archipelago/settings_screen.gd')
-rw-r--r-- | Archipelago/settings_screen.gd | 35 |
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): | |||
109 | func connectionSuccessful(): | 126 | func 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 | |||
161 | func 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] | ||