about summary refs log tree commit diff stats
path: root/Archipelago/load.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-04-13 18:09:30 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-04-13 18:09:30 -0400
commit617e31fce21eb18d1ffccdc9c377d25535157351 (patch)
treec1fbcee75a67062663a0fe1ff00f4be1db382be1 /Archipelago/load.gd
parent679bba3b46ea30a329c617b3cc47645d540a261f (diff)
downloadlingo-archipelago-617e31fce21eb18d1ffccdc9c377d25535157351.tar.gz
lingo-archipelago-617e31fce21eb18d1ffccdc9c377d25535157351.tar.bz2
lingo-archipelago-617e31fce21eb18d1ffccdc9c377d25535157351.zip
It WORKS!
You can send checks and receive door items!
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r--Archipelago/load.gd36
1 files changed, 36 insertions, 0 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd new file mode 100644 index 0000000..b0ccafc --- /dev/null +++ b/Archipelago/load.gd
@@ -0,0 +1,36 @@
1extends "res://scripts/load.gd"
2
3
4func _load():
5 global._print("Hooked Load Start")
6
7 var apclient = global.get_node("Archipelago")
8
9 # TODO: Override the YOU panel with the AP slot name
10
11 # This is the best time to create the location nodes, since the map is now
12 # loaded but the panels haven't been solved from the save file yet.
13 var panels_parent = self.get_node("Panels")
14 var location_script = ResourceLoader.load("user://maps/Archipelago/location.gd")
15 for location_name in apclient._location_name_to_id:
16 var location = location_script.new()
17 location.ap_name = location_name
18 location.ap_id = apclient._location_name_to_id[location_name]
19 location.name = "AP_location_" + location.ap_id
20 self.add_child(location)
21
22 var panels = apclient._panel_ids_by_location[String(location.ap_id)]
23 location.total = panels.size()
24
25 for panel in panels:
26 var that_panel = panels_parent.get_node(panel)
27 that_panel.get_node("Viewport/GUI/Panel/TextEdit").connect(
28 "answer_correct", location, "handle_correct"
29 )
30
31 # Process any items received while the map was loading.
32 apclient.mapFinishedLoading()
33
34 # Proceed with the rest of the load.
35 global._print("Hooked Load End")
36 ._load()