diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/Archipelago/client.gd | 6 | ||||
-rw-r--r-- | client/Archipelago/manager.gd | 17 | ||||
-rw-r--r-- | client/Archipelago/settings_screen.gd | 38 | ||||
-rw-r--r-- | client/CHANGELOG.md | 21 | ||||
-rw-r--r-- | client/archipelago.tscn | 5 |
5 files changed, 82 insertions, 5 deletions
diff --git a/client/Archipelago/client.gd b/client/Archipelago/client.gd index 2e080fd..843647d 100644 --- a/client/Archipelago/client.gd +++ b/client/Archipelago/client.gd | |||
@@ -47,6 +47,8 @@ signal location_scout_received(item_id, location_id, player, flags) | |||
47 | func _init(): | 47 | func _init(): |
48 | set_process_mode(Node.PROCESS_MODE_ALWAYS) | 48 | set_process_mode(Node.PROCESS_MODE_ALWAYS) |
49 | 49 | ||
50 | _ws.inbound_buffer_size = 8388608 | ||
51 | |||
50 | global._print("Instantiated APClient") | 52 | global._print("Instantiated APClient") |
51 | 53 | ||
52 | # Read AP datapackages from file, if there are any | 54 | # Read AP datapackages from file, if there are any |
@@ -225,7 +227,7 @@ func _process(_delta): | |||
225 | error_message = "Unknown error." | 227 | error_message = "Unknown error." |
226 | 228 | ||
227 | _initiated_disconnect = true | 229 | _initiated_disconnect = true |
228 | _ws.disconnect_from_host() | 230 | _ws.close() |
229 | 231 | ||
230 | emit_signal("could_not_connect", error_message) | 232 | emit_signal("could_not_connect", error_message) |
231 | global._print("Connection to AP refused") | 233 | global._print("Connection to AP refused") |
@@ -309,7 +311,7 @@ func connectToServer(server, un, pw): | |||
309 | % err | 311 | % err |
310 | ) | 312 | ) |
311 | ) | 313 | ) |
312 | global._print("Could not connect to AP: " + err) | 314 | global._print("Could not connect to AP: %d" % err) |
313 | return | 315 | return |
314 | _should_process = true | 316 | _should_process = true |
315 | 317 | ||
diff --git a/client/Archipelago/manager.gd b/client/Archipelago/manager.gd index 25f68c1..34f5e27 100644 --- a/client/Archipelago/manager.gd +++ b/client/Archipelago/manager.gd | |||
@@ -1,6 +1,6 @@ | |||
1 | extends Node | 1 | extends Node |
2 | 2 | ||
3 | const MOD_VERSION = 1 | 3 | const MOD_VERSION = 3 |
4 | 4 | ||
5 | var SCRIPT_client | 5 | var SCRIPT_client |
6 | var SCRIPT_keyboard | 6 | var SCRIPT_keyboard |
@@ -41,11 +41,13 @@ const kCYAN_DOOR_BEHAVIOR_H2 = 0 | |||
41 | const kCYAN_DOOR_BEHAVIOR_DOUBLE_LETTER = 1 | 41 | const kCYAN_DOOR_BEHAVIOR_DOUBLE_LETTER = 1 |
42 | const kCYAN_DOOR_BEHAVIOR_ITEM = 2 | 42 | const kCYAN_DOOR_BEHAVIOR_ITEM = 2 |
43 | 43 | ||
44 | var apworld_version = [0, 0] | ||
44 | var cyan_door_behavior = kCYAN_DOOR_BEHAVIOR_H2 | 45 | var cyan_door_behavior = kCYAN_DOOR_BEHAVIOR_H2 |
45 | var daedalus_roof_access = false | 46 | var daedalus_roof_access = false |
46 | var keyholder_sanity = false | 47 | var keyholder_sanity = false |
47 | var shuffle_control_center_colors = false | 48 | var shuffle_control_center_colors = false |
48 | var shuffle_doors = false | 49 | var shuffle_doors = false |
50 | var shuffle_gallery_paintings = false | ||
49 | var shuffle_letters = kSHUFFLE_LETTERS_VANILLA | 51 | var shuffle_letters = kSHUFFLE_LETTERS_VANILLA |
50 | var shuffle_symbols = false | 52 | var shuffle_symbols = false |
51 | var victory_condition = -1 | 53 | var victory_condition = -1 |
@@ -327,8 +329,8 @@ func _process_location_scout(item_id, location_id, player, flags): | |||
327 | collectable.setScoutedText(item_name) | 329 | collectable.setScoutedText(item_name) |
328 | 330 | ||
329 | 331 | ||
330 | func _client_could_not_connect(): | 332 | func _client_could_not_connect(message): |
331 | emit_signal("could_not_connect") | 333 | emit_signal("could_not_connect", message) |
332 | 334 | ||
333 | 335 | ||
334 | func _client_connect_status(message): | 336 | func _client_connect_status(message): |
@@ -361,10 +363,14 @@ func _client_connected(slot_data): | |||
361 | keyholder_sanity = bool(slot_data.get("keyholder_sanity", false)) | 363 | keyholder_sanity = bool(slot_data.get("keyholder_sanity", false)) |
362 | shuffle_control_center_colors = bool(slot_data.get("shuffle_control_center_colors", false)) | 364 | shuffle_control_center_colors = bool(slot_data.get("shuffle_control_center_colors", false)) |
363 | shuffle_doors = bool(slot_data.get("shuffle_doors", false)) | 365 | shuffle_doors = bool(slot_data.get("shuffle_doors", false)) |
366 | shuffle_gallery_paintings = bool(slot_data.get("shuffle_gallery_paintings", false)) | ||
364 | shuffle_letters = int(slot_data.get("shuffle_letters", 0)) | 367 | shuffle_letters = int(slot_data.get("shuffle_letters", 0)) |
365 | shuffle_symbols = bool(slot_data.get("shuffle_symbols", false)) | 368 | shuffle_symbols = bool(slot_data.get("shuffle_symbols", false)) |
366 | victory_condition = int(slot_data.get("victory_condition", 0)) | 369 | victory_condition = int(slot_data.get("victory_condition", 0)) |
367 | 370 | ||
371 | if slot_data.has("version"): | ||
372 | apworld_version = [int(slot_data["version"][0]), int(slot_data["version"][1])] | ||
373 | |||
368 | # Set up item locks. | 374 | # Set up item locks. |
369 | _item_locks = {} | 375 | _item_locks = {} |
370 | 376 | ||
@@ -399,6 +405,11 @@ func _client_connected(slot_data): | |||
399 | for door in door_group.get_doors(): | 405 | for door in door_group.get_doors(): |
400 | _item_locks[door] = [door_group.get_ap_id(), 1] | 406 | _item_locks[door] = [door_group.get_ap_id(), 1] |
401 | 407 | ||
408 | if shuffle_gallery_paintings: | ||
409 | for door in gamedata.objects.get_doors(): | ||
410 | if door.get_type() == gamedata.SCRIPT_proto.DoorType.GALLERY_PAINTING: | ||
411 | _item_locks[door.get_id()] = [door.get_ap_id(), 1] | ||
412 | |||
402 | if cyan_door_behavior == kCYAN_DOOR_BEHAVIOR_ITEM: | 413 | if cyan_door_behavior == kCYAN_DOOR_BEHAVIOR_ITEM: |
403 | for door_group in gamedata.objects.get_door_groups(): | 414 | for door_group in gamedata.objects.get_door_groups(): |
404 | if door_group.get_type() == gamedata.SCRIPT_proto.DoorGroupType.CYAN_DOORS: | 415 | if door_group.get_type() == gamedata.SCRIPT_proto.DoorGroupType.CYAN_DOORS: |
diff --git a/client/Archipelago/settings_screen.gd b/client/Archipelago/settings_screen.gd index 81e7d3f..2236672 100644 --- a/client/Archipelago/settings_screen.gd +++ b/client/Archipelago/settings_screen.gd | |||
@@ -100,6 +100,10 @@ func _ready(): | |||
100 | $Panel/player_box.add_theme_font_size_override("font_size", 36) | 100 | $Panel/player_box.add_theme_font_size_override("font_size", 36) |
101 | $Panel/password_box.add_theme_font_size_override("font_size", 36) | 101 | $Panel/password_box.add_theme_font_size_override("font_size", 36) |
102 | 102 | ||
103 | # Set up version mismatch dialog. | ||
104 | $Panel/VersionMismatch.connect("confirmed", startGame) | ||
105 | $Panel/VersionMismatch.get_cancel_button().pressed.connect(versionMismatchDeclined) | ||
106 | |||
103 | 107 | ||
104 | # Adapted from https://gitlab.com/Delta-V-Modding/Mods/-/blob/main/game/ModLoader.gd | 108 | # Adapted from https://gitlab.com/Delta-V-Modding/Mods/-/blob/main/game/ModLoader.gd |
105 | func installScriptExtension(childScript: Resource): | 109 | func installScriptExtension(childScript: Resource): |
@@ -129,6 +133,33 @@ func connectionStatus(message): | |||
129 | 133 | ||
130 | func connectionSuccessful(): | 134 | func connectionSuccessful(): |
131 | var ap = global.get_node("Archipelago") | 135 | var ap = global.get_node("Archipelago") |
136 | var gamedata = global.get_node("Gamedata") | ||
137 | |||
138 | # Check for major version mismatch. | ||
139 | if ap.apworld_version[0] != gamedata.objects.get_version(): | ||
140 | $Panel/AcceptDialog.exclusive = false | ||
141 | |||
142 | var popup = self.get_node("Panel/VersionMismatch") | ||
143 | popup.title = "Version Mismatch!" | ||
144 | popup.dialog_text = ( | ||
145 | "This slot was generated using v%d.%d of the Lingo 2 apworld,\nwhich has a different major version than this client (v%d.%d).\nIt is highly recommended to play using the correct version of the client.\nYou may experience bugs or logic issues if you continue." | ||
146 | % [ | ||
147 | ap.apworld_version[0], | ||
148 | ap.apworld_version[1], | ||
149 | gamedata.objects.get_version(), | ||
150 | ap.MOD_VERSION | ||
151 | ] | ||
152 | ) | ||
153 | popup.exclusive = true | ||
154 | popup.popup_centered() | ||
155 | |||
156 | return | ||
157 | |||
158 | startGame() | ||
159 | |||
160 | |||
161 | func startGame(): | ||
162 | var ap = global.get_node("Archipelago") | ||
132 | 163 | ||
133 | # Save connection details | 164 | # Save connection details |
134 | var connection_details = [ap.ap_server, ap.ap_user, ap.ap_pass] | 165 | var connection_details = [ap.ap_server, ap.ap_user, ap.ap_pass] |
@@ -192,6 +223,13 @@ func connectionUnsuccessful(error_message): | |||
192 | popup.get_ok_button().visible = true | 223 | popup.get_ok_button().visible = true |
193 | popup.popup_centered() | 224 | popup.popup_centered() |
194 | 225 | ||
226 | $Panel/connect_button.disabled = false | ||
227 | |||
228 | |||
229 | func versionMismatchDeclined(): | ||
230 | $Panel/AcceptDialog.hide() | ||
231 | $Panel/connect_button.disabled = false | ||
232 | |||
195 | 233 | ||
196 | func historySelected(index): | 234 | func historySelected(index): |
197 | var ap = global.get_node("Archipelago") | 235 | var ap = global.get_node("Archipelago") |
diff --git a/client/CHANGELOG.md b/client/CHANGELOG.md new file mode 100644 index 0000000..89d9873 --- /dev/null +++ b/client/CHANGELOG.md | |||
@@ -0,0 +1,21 @@ | |||
1 | # lingo2-archipelago Client Releases | ||
2 | |||
3 | ## v3.3 - 2025-09-12 | ||
4 | |||
5 | - Fixed issue downloading large datapackages (such as TUNIC's). | ||
6 | - Connection failures now show error messages. | ||
7 | |||
8 | Download: | ||
9 | [lingo2-archipelago-client-v3.3.zip](https://files.fourisland.com/releases/lingo2-archipelago/client/lingo2-archipelago-client-v3.3.zip)<br/> | ||
10 | Source: | ||
11 | [v3.3](https://code.fourisland.com/lingo2-archipelago/tag/?h=client-v3.3) | ||
12 | |||
13 | ## v3.2 - 2025-09-12 | ||
14 | |||
15 | - Initial release for testing. Features include door shuffle, letter shuffle, | ||
16 | and symbol shuffle. | ||
17 | |||
18 | Download: | ||
19 | [lingo2-archipelago-client-v3.2.zip](https://files.fourisland.com/releases/lingo2-archipelago/client/lingo2-archipelago-client-v3.2.zip)<br/> | ||
20 | Source: | ||
21 | [v3.2](https://code.fourisland.com/lingo2-archipelago/tag/?h=client-v3.2) | ||
diff --git a/client/archipelago.tscn b/client/archipelago.tscn index 40dd46f..da83b23 100644 --- a/client/archipelago.tscn +++ b/client/archipelago.tscn | |||
@@ -40,6 +40,7 @@ offset_right = 1920.0 | |||
40 | offset_bottom = 225.0 | 40 | offset_bottom = 225.0 |
41 | text = "ARCHIPELAGO" | 41 | text = "ARCHIPELAGO" |
42 | valign = 1 | 42 | valign = 1 |
43 | horizontal_alignment = 1 | ||
43 | theme = ExtResource("2_g4bvn") | 44 | theme = ExtResource("2_g4bvn") |
44 | 45 | ||
45 | [node name="credit" parent="Panel" type="Label"] | 46 | [node name="credit" parent="Panel" type="Label"] |
@@ -150,6 +151,10 @@ caret_blink = true | |||
150 | offset_right = 83.0 | 151 | offset_right = 83.0 |
151 | offset_bottom = 58.0 | 152 | offset_bottom = 58.0 |
152 | 153 | ||
154 | [node name="VersionMismatch" type="ConfirmationDialog" parent="Panel"] | ||
155 | offset_right = 83.0 | ||
156 | offset_bottom = 58.0 | ||
157 | |||
153 | [node name="connection_history" type="MenuButton" parent="Panel"] | 158 | [node name="connection_history" type="MenuButton" parent="Panel"] |
154 | offset_left = 1239.0 | 159 | offset_left = 1239.0 |
155 | offset_top = 276.0 | 160 | offset_top = 276.0 |