diff options
Diffstat (limited to 'client/Archipelago/settings_screen.gd')
-rw-r--r-- | client/Archipelago/settings_screen.gd | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/Archipelago/settings_screen.gd b/client/Archipelago/settings_screen.gd index 81e7d3f..14975e5 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] |
@@ -193,6 +224,10 @@ func connectionUnsuccessful(error_message): | |||
193 | popup.popup_centered() | 224 | popup.popup_centered() |
194 | 225 | ||
195 | 226 | ||
227 | func versionMismatchDeclined(): | ||
228 | $Panel/AcceptDialog.hide() | ||
229 | |||
230 | |||
196 | func historySelected(index): | 231 | func historySelected(index): |
197 | var ap = global.get_node("Archipelago") | 232 | var ap = global.get_node("Archipelago") |
198 | var details = ap.connection_history[index] | 233 | var details = ap.connection_history[index] |