about summary refs log tree commit diff stats
path: root/Archipelago
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-09-11 16:52:39 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-09-11 16:52:39 -0400
commit3dc880b18277e4587aeb167f1f831bc8f1b9bf48 (patch)
tree2e08a798522882c4527632a0245229b5243b440b /Archipelago
parent3d51a24e12ab8a84631c54852b4b5b43144676ed (diff)
downloadlingo-archipelago-3dc880b18277e4587aeb167f1f831bc8f1b9bf48.tar.gz
lingo-archipelago-3dc880b18277e4587aeb167f1f831bc8f1b9bf48.tar.bz2
lingo-archipelago-3dc880b18277e4587aeb167f1f831bc8f1b9bf48.zip
Use static item/location IDs
Diffstat (limited to 'Archipelago')
-rw-r--r--Archipelago/client.gd8
-rw-r--r--Archipelago/load.gd41
2 files changed, 23 insertions, 26 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 9f15506..068f300 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -588,16 +588,16 @@ func processItem(item, index, from, flags):
588 if _item_id_to_name.has(item): 588 if _item_id_to_name.has(item):
589 item_name = _item_id_to_name[item] 589 item_name = _item_id_to_name[item]
590 590
591 if gamedata.door_ids_by_item_id.has(item_name): 591 if gamedata.door_ids_by_item_id.has(int(item)):
592 var doorsNode = get_tree().get_root().get_node("Spatial/Doors") 592 var doorsNode = get_tree().get_root().get_node("Spatial/Doors")
593 for door_id in gamedata.door_ids_by_item_id[item_name]: 593 for door_id in gamedata.door_ids_by_item_id[int(item)]:
594 doorsNode.get_node(door_id).openDoor() 594 doorsNode.get_node(door_id).openDoor()
595 595
596 if gamedata.painting_ids_by_item_id.has(item_name): 596 if gamedata.painting_ids_by_item_id.has(int(item)):
597 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") 597 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings")
598 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") 598 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings")
599 599
600 for painting_id in gamedata.painting_ids_by_item_id[item_name]: 600 for painting_id in gamedata.painting_ids_by_item_id[int(item)]:
601 var painting_node = real_parent_node.get_node_or_null(painting_id) 601 var painting_node = real_parent_node.get_node_or_null(painting_id)
602 if painting_node != null: 602 if painting_node != null:
603 painting_node.movePainting() 603 painting_node.movePainting()
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.