diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-01-04 13:36:37 -0500 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-01-04 13:36:37 -0500 |
| commit | 49209d18a4a5a78f5ad997b948d7812a22e9da4e (patch) | |
| tree | 2b9ccb2daca4b0b2d1975b1decf0b0e35bf0b9be /Archipelago/load.gd | |
| parent | 1b76d1f564f62217d285eaa3820876c07d62293c (diff) | |
| download | lingo-archipelago-49209d18a4a5a78f5ad997b948d7812a22e9da4e.tar.gz lingo-archipelago-49209d18a4a5a78f5ad997b948d7812a22e9da4e.tar.bz2 lingo-archipelago-49209d18a4a5a78f5ad997b948d7812a22e9da4e.zip | |
Stack/double proxying
Diffstat (limited to 'Archipelago/load.gd')
| -rw-r--r-- | Archipelago/load.gd | 23 |
1 files changed, 22 insertions, 1 deletions
| diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 2835bb4..409b8c8 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
| @@ -22,6 +22,7 @@ func _load(): | |||
| 22 | global._print("Hooked Load Start") | 22 | global._print("Hooked Load Start") |
| 23 | 23 | ||
| 24 | var apclient = global.get_node("Archipelago") | 24 | var apclient = global.get_node("Archipelago") |
| 25 | var panels_parent = self.get_node("Panels") | ||
| 25 | 26 | ||
| 26 | # Override the YOU panel with the AP slot name. | 27 | # Override the YOU panel with the AP slot name. |
| 27 | if self.get_node_or_null("Panels/Color Arrow Room/Panel_you") != null: | 28 | if self.get_node_or_null("Panels/Color Arrow Room/Panel_you") != null: |
| @@ -117,7 +118,6 @@ func _load(): | |||
| 117 | # This is the best time to create the location nodes, since the map is now | 118 | # This is the best time to create the location nodes, since the map is now |
| 118 | # loaded but the panels haven't been solved from the save file yet. | 119 | # loaded but the panels haven't been solved from the save file yet. |
| 119 | var gamedata = apclient.get_node("Gamedata") | 120 | var gamedata = apclient.get_node("Gamedata") |
| 120 | var panels_parent = self.get_node("Panels") | ||
| 121 | var location_script = apclient.SCRIPT_location | 121 | var location_script = apclient.SCRIPT_location |
| 122 | for location_id in gamedata.panel_ids_by_location_id.keys(): | 122 | for location_id in gamedata.panel_ids_by_location_id.keys(): |
| 123 | if not (gamedata.classification_by_location_id[location_id] & apclient._location_classification_bit): | 123 | if not (gamedata.classification_by_location_id[location_id] & apclient._location_classification_bit): |
| @@ -437,6 +437,27 @@ func _load(): | |||
| 437 | script_instance.name = "Hunt_Notifier" | 437 | script_instance.name = "Hunt_Notifier" |
| 438 | script_instance.key = "Hunt|%d" % panel["loc"] | 438 | script_instance.key = "Hunt|%d" % panel["loc"] |
| 439 | panel_node.add_child(script_instance) | 439 | panel_node.add_child(script_instance) |
| 440 | |||
| 441 | # Make stack/double puzzles into proxies, unless panelsanity is on. | ||
| 442 | if apclient._location_classification_bit != apclient.kCLASSIFICATION_LOCAL_INSANITY: | ||
| 443 | var proxyscript = load("res://scripts/panelProxy.gd") | ||
| 444 | |||
| 445 | var extradata_proxies = apclient.get_node("Extradata").proxies | ||
| 446 | for truepanel in extradata_proxies: | ||
| 447 | var proxies = extradata_proxies[truepanel] | ||
| 448 | for proxypanel in proxies: | ||
| 449 | var proxynode = panels_parent.get_node(proxypanel) | ||
| 450 | var oldparent = proxynode.get_parent() | ||
| 451 | oldparent.remove_child(proxynode) | ||
| 452 | var oldtext = proxynode.text | ||
| 453 | var oldanswer = proxynode.answer | ||
| 454 | proxynode.set_script(proxyscript) | ||
| 455 | proxynode.text = oldtext | ||
| 456 | proxynode.answer = oldanswer | ||
| 457 | proxynode.proxied_panels = ["../../%s" % truepanel] | ||
| 458 | proxynode.exact_proxy = true | ||
| 459 | proxynode.request_ready() | ||
| 460 | oldparent.add_child(proxynode) | ||
| 440 | 461 | ||
| 441 | # Attach a script to every panel so that we can do things like conditionally | 462 | # Attach a script to every panel so that we can do things like conditionally |
| 442 | # disable them. | 463 | # disable them. |
