diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-09-11 16:52:39 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-09-11 16:52:39 -0400 |
commit | 3dc880b18277e4587aeb167f1f831bc8f1b9bf48 (patch) | |
tree | 2e08a798522882c4527632a0245229b5243b440b /Archipelago/load.gd | |
parent | 3d51a24e12ab8a84631c54852b4b5b43144676ed (diff) | |
download | lingo-archipelago-3dc880b18277e4587aeb167f1f831bc8f1b9bf48.tar.gz lingo-archipelago-3dc880b18277e4587aeb167f1f831bc8f1b9bf48.tar.bz2 lingo-archipelago-3dc880b18277e4587aeb167f1f831bc8f1b9bf48.zip |
Use static item/location IDs
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r-- | Archipelago/load.gd | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 876910b..d2977dd 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -114,28 +114,25 @@ func _load(): | |||
114 | var panels_parent = self.get_node("Panels") | 114 | var panels_parent = self.get_node("Panels") |
115 | var location_script = ResourceLoader.load("user://maps/Archipelago/location.gd") | 115 | var location_script = ResourceLoader.load("user://maps/Archipelago/location.gd") |
116 | for location_id in gamedata.panel_ids_by_location_id.keys(): | 116 | for location_id in gamedata.panel_ids_by_location_id.keys(): |
117 | if apclient._location_name_to_id.has(location_id): | 117 | var location = location_script.new() |
118 | var location = location_script.new() | 118 | location.ap_id = location_id |
119 | location.ap_id = int(apclient._location_name_to_id[location_id]) | 119 | location.name = "AP_location_%d" % location.ap_id |
120 | location.name = "AP_location_%d" % location.ap_id | 120 | location.classification = gamedata.classification_by_location_id[location_id] |
121 | location.classification = gamedata.classification_by_location_id[location_id] | 121 | self.add_child(location) |
122 | self.add_child(location) | 122 | |
123 | 123 | var panels = gamedata.panel_ids_by_location_id[location_id] | |
124 | var panels = gamedata.panel_ids_by_location_id[location_id] | 124 | location.total = panels.size() |
125 | location.total = panels.size() | 125 | |
126 | 126 | for panel in panels: | |
127 | for panel in panels: | 127 | var that_panel |
128 | var that_panel | 128 | if panel.begins_with("EndPanel"): |
129 | if panel.begins_with("EndPanel"): | 129 | that_panel = self.get_node("Decorations").get_node(panel) |
130 | that_panel = self.get_node("Decorations").get_node(panel) | 130 | else: |
131 | else: | 131 | that_panel = panels_parent.get_node(panel) |
132 | that_panel = panels_parent.get_node(panel) | 132 | |
133 | 133 | that_panel.get_node("Viewport/GUI/Panel/TextEdit").connect( | |
134 | that_panel.get_node("Viewport/GUI/Panel/TextEdit").connect( | 134 | "answer_correct", location, "handle_correct" |
135 | "answer_correct", location, "handle_correct" | 135 | ) |
136 | ) | ||
137 | else: | ||
138 | global._print("Could not find location ID for %s" % location_id) | ||
139 | 136 | ||
140 | # HOT CRUSTS should be at eye-level, have a yellow block behind it, and | 137 | # HOT CRUSTS should be at eye-level, have a yellow block behind it, and |
141 | # not vanish when solved. | 138 | # not vanish when solved. |