diff options
Diffstat (limited to 'apworld/client/main.gd')
| -rw-r--r-- | apworld/client/main.gd | 37 |
1 files changed, 30 insertions, 7 deletions
| diff --git a/apworld/client/main.gd b/apworld/client/main.gd index 8425d8c..c90d6e7 100644 --- a/apworld/client/main.gd +++ b/apworld/client/main.gd | |||
| @@ -36,6 +36,7 @@ func _ready(): | |||
| 36 | global.add_child(ap_instance) | 36 | global.add_child(ap_instance) |
| 37 | 37 | ||
| 38 | # Let's also inject any scripts we need to inject now. | 38 | # Let's also inject any scripts we need to inject now. |
| 39 | installScriptExtension(runtime.load_script("allowNumbers.gd")) | ||
| 39 | installScriptExtension(runtime.load_script("animationListener.gd")) | 40 | installScriptExtension(runtime.load_script("animationListener.gd")) |
| 40 | installScriptExtension(runtime.load_script("collectable.gd")) | 41 | installScriptExtension(runtime.load_script("collectable.gd")) |
| 41 | installScriptExtension(runtime.load_script("door.gd")) | 42 | installScriptExtension(runtime.load_script("door.gd")) |
| @@ -43,12 +44,14 @@ func _ready(): | |||
| 43 | installScriptExtension(runtime.load_script("keyHolderChecker.gd")) | 44 | installScriptExtension(runtime.load_script("keyHolderChecker.gd")) |
| 44 | installScriptExtension(runtime.load_script("keyHolderResetterListener.gd")) | 45 | installScriptExtension(runtime.load_script("keyHolderResetterListener.gd")) |
| 45 | installScriptExtension(runtime.load_script("painting.gd")) | 46 | installScriptExtension(runtime.load_script("painting.gd")) |
| 47 | installScriptExtension(runtime.load_script("paintingAuto.gd")) | ||
| 46 | installScriptExtension(runtime.load_script("panel.gd")) | 48 | installScriptExtension(runtime.load_script("panel.gd")) |
| 47 | installScriptExtension(runtime.load_script("pauseMenu.gd")) | 49 | installScriptExtension(runtime.load_script("pauseMenu.gd")) |
| 48 | installScriptExtension(runtime.load_script("player.gd")) | 50 | installScriptExtension(runtime.load_script("player.gd")) |
| 49 | installScriptExtension(runtime.load_script("saver.gd")) | 51 | installScriptExtension(runtime.load_script("saver.gd")) |
| 50 | installScriptExtension(runtime.load_script("teleport.gd")) | 52 | installScriptExtension(runtime.load_script("teleport.gd")) |
| 51 | installScriptExtension(runtime.load_script("teleportListener.gd")) | 53 | installScriptExtension(runtime.load_script("teleportListener.gd")) |
| 54 | installScriptExtension(runtime.load_script("unlockReaderListener.gd")) | ||
| 52 | installScriptExtension(runtime.load_script("visibilityListener.gd")) | 55 | installScriptExtension(runtime.load_script("visibilityListener.gd")) |
| 53 | installScriptExtension(runtime.load_script("worldport.gd")) | 56 | installScriptExtension(runtime.load_script("worldport.gd")) |
| 54 | installScriptExtension(runtime.load_script("worldportListener.gd")) | 57 | installScriptExtension(runtime.load_script("worldportListener.gd")) |
| @@ -66,6 +69,11 @@ func _ready(): | |||
| 66 | messages_instance.SCRIPT_rainbowText = runtime.load_script("rainbowText.gd") | 69 | messages_instance.SCRIPT_rainbowText = runtime.load_script("rainbowText.gd") |
| 67 | global.add_child(messages_instance) | 70 | global.add_child(messages_instance) |
| 68 | 71 | ||
| 72 | var effects_script = runtime.load_script("effects.gd") | ||
| 73 | var effects_instance = effects_script.new() | ||
| 74 | effects_instance.name = "Effects" | ||
| 75 | global.add_child(effects_instance) | ||
| 76 | |||
| 69 | var textclient_script = runtime.load_script("textclient.gd") | 77 | var textclient_script = runtime.load_script("textclient.gd") |
| 70 | var textclient_instance = textclient_script.new() | 78 | var textclient_instance = textclient_script.new() |
| 71 | textclient_instance.name = "Textclient" | 79 | textclient_instance.name = "Textclient" |
| @@ -77,6 +85,13 @@ func _ready(): | |||
| 77 | compass_overlay_instance.SCRIPT_compass = runtime.load_script("compass.gd") | 85 | compass_overlay_instance.SCRIPT_compass = runtime.load_script("compass.gd") |
| 78 | global.add_child(compass_overlay_instance) | 86 | global.add_child(compass_overlay_instance) |
| 79 | 87 | ||
| 88 | unlocks.data["advanced_mastery"] = "" | ||
| 89 | unlocks.data["charismatic_mastery"] = "" | ||
| 90 | unlocks.data["crystalline_mastery"] = "" | ||
| 91 | unlocks.data["fuzzy_mastery"] = "" | ||
| 92 | unlocks.data["icarus_mastery"] = "" | ||
| 93 | unlocks.data["stellar_mastery"] = "" | ||
| 94 | |||
| 80 | var ap = global.get_node("Archipelago") | 95 | var ap = global.get_node("Archipelago") |
| 81 | var gamedata = global.get_node("Gamedata") | 96 | var gamedata = global.get_node("Gamedata") |
| 82 | ap.ap_connected.connect(connectionSuccessful) | 97 | ap.ap_connected.connect(connectionSuccessful) |
| @@ -102,8 +117,9 @@ func _ready(): | |||
| 102 | history_box.get_popup().id_pressed.connect(historySelected) | 117 | history_box.get_popup().id_pressed.connect(historySelected) |
| 103 | 118 | ||
| 104 | # Show client version. | 119 | # Show client version. |
| 120 | var version = gamedata.objects.get_version() | ||
| 105 | get_node("../Panel/title").text = ( | 121 | get_node("../Panel/title").text = ( |
| 106 | "ARCHIPELAGO (%d.%d)" % [gamedata.objects.get_version(), ap.MOD_VERSION] | 122 | "ARCHIPELAGO (%d.%d.%d)" % [version.get_major(), version.get_minor(), version.get_patch()] |
| 107 | ) | 123 | ) |
| 108 | 124 | ||
| 109 | # Increase font size in text boxes. | 125 | # Increase font size in text boxes. |
| @@ -173,18 +189,20 @@ func connectionSuccessful(): | |||
| 173 | var gamedata = global.get_node("Gamedata") | 189 | var gamedata = global.get_node("Gamedata") |
| 174 | 190 | ||
| 175 | # Check for major version mismatch. | 191 | # Check for major version mismatch. |
| 176 | if ap.apworld_version[0] != gamedata.objects.get_version(): | 192 | if ap.apworld_version[0] != gamedata.objects.get_version().get_major(): |
| 177 | get_node("../Panel/AcceptDialog").exclusive = false | 193 | get_node("../Panel/AcceptDialog").exclusive = false |
| 178 | 194 | ||
| 179 | var popup = get_node("../Panel/VersionMismatch") | 195 | var popup = get_node("../Panel/VersionMismatch") |
| 180 | popup.title = "Version Mismatch!" | 196 | popup.title = "Version Mismatch!" |
| 181 | popup.dialog_text = ( | 197 | popup.dialog_text = ( |
| 182 | "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." | 198 | "This slot was generated using v%d.%d.%d of the Lingo 2 apworld,\nwhich has a different major version than this client (v%d.%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." |
| 183 | % [ | 199 | % [ |
| 184 | ap.apworld_version[0], | 200 | ap.apworld_version[0], |
| 185 | ap.apworld_version[1], | 201 | ap.apworld_version[1], |
| 186 | gamedata.objects.get_version(), | 202 | ap.apworld_version[2], |
| 187 | ap.MOD_VERSION | 203 | gamedata.objects.get_version().get_major(), |
| 204 | gamedata.objects.get_version().get_minor(), | ||
| 205 | gamedata.objects.get_version().get_patch() | ||
| 188 | ] | 206 | ] |
| 189 | ) | 207 | ) |
| 190 | popup.exclusive = true | 208 | popup.exclusive = true |
| @@ -215,11 +233,11 @@ func startGame(): | |||
| 215 | 233 | ||
| 216 | unlocks.resetCollectables() | 234 | unlocks.resetCollectables() |
| 217 | unlocks.resetData() | 235 | unlocks.resetData() |
| 236 | unlocks.loadCollectables() | ||
| 237 | unlocks.loadData() | ||
| 218 | 238 | ||
| 219 | ap.setup_keys() | 239 | ap.setup_keys() |
| 220 | 240 | ||
| 221 | unlocks.loadCollectables() | ||
| 222 | unlocks.loadData() | ||
| 223 | unlocks.unlockKey("capslock", 1) | 241 | unlocks.unlockKey("capslock", 1) |
| 224 | 242 | ||
| 225 | if ap.shuffle_worldports: | 243 | if ap.shuffle_worldports: |
| @@ -228,6 +246,7 @@ func startGame(): | |||
| 228 | settings.worldport_fades = "never" | 246 | settings.worldport_fades = "never" |
| 229 | 247 | ||
| 230 | clearResourceCache("res://objects/meshes/gridDoor.tscn") | 248 | clearResourceCache("res://objects/meshes/gridDoor.tscn") |
| 249 | clearResourceCache("res://objects/nodes/allowNumbers.tscn") | ||
| 231 | clearResourceCache("res://objects/nodes/collectable.tscn") | 250 | clearResourceCache("res://objects/nodes/collectable.tscn") |
| 232 | clearResourceCache("res://objects/nodes/door.tscn") | 251 | clearResourceCache("res://objects/nodes/door.tscn") |
| 233 | clearResourceCache("res://objects/nodes/keyHolder.tscn") | 252 | clearResourceCache("res://objects/nodes/keyHolder.tscn") |
| @@ -235,6 +254,7 @@ func startGame(): | |||
| 235 | clearResourceCache("res://objects/nodes/listeners/keyHolderChecker.tscn") | 254 | clearResourceCache("res://objects/nodes/listeners/keyHolderChecker.tscn") |
| 236 | clearResourceCache("res://objects/nodes/listeners/keyHolderResetterListener.tscn") | 255 | clearResourceCache("res://objects/nodes/listeners/keyHolderResetterListener.tscn") |
| 237 | clearResourceCache("res://objects/nodes/listeners/teleportListener.tscn") | 256 | clearResourceCache("res://objects/nodes/listeners/teleportListener.tscn") |
| 257 | clearResourceCache("res://objects/nodes/listeners/unlockReaderListener.tscn") | ||
| 238 | clearResourceCache("res://objects/nodes/listeners/visibilityListener.tscn") | 258 | clearResourceCache("res://objects/nodes/listeners/visibilityListener.tscn") |
| 239 | clearResourceCache("res://objects/nodes/listeners/worldportListener.tscn") | 259 | clearResourceCache("res://objects/nodes/listeners/worldportListener.tscn") |
| 240 | clearResourceCache("res://objects/nodes/panel.tscn") | 260 | clearResourceCache("res://objects/nodes/panel.tscn") |
| @@ -271,6 +291,9 @@ func versionMismatchDeclined(): | |||
| 271 | get_node("../Panel/AcceptDialog").hide() | 291 | get_node("../Panel/AcceptDialog").hide() |
| 272 | get_node("../Panel/connect_button").disabled = false | 292 | get_node("../Panel/connect_button").disabled = false |
| 273 | 293 | ||
| 294 | var ap = global.get_node("Archipelago") | ||
| 295 | ap.disconnect_from_ap() | ||
| 296 | |||
| 274 | 297 | ||
| 275 | func historySelected(index): | 298 | func historySelected(index): |
| 276 | var ap = global.get_node("Archipelago") | 299 | var ap = global.get_node("Archipelago") |
