about summary refs log tree commit diff stats
path: root/Archipelago
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago')
-rw-r--r--Archipelago/client.gd6
-rw-r--r--Archipelago/load.gd12
-rw-r--r--Archipelago/notifier.gd14
3 files changed, 31 insertions, 1 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 0326ffb..d7074f5 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -540,6 +540,12 @@ func sendLocation(loc_id):
540 _held_locations.append(loc_id) 540 _held_locations.append(loc_id)
541 541
542 542
543func setValue(key, value):
544 sendMessage(
545 [{"cmd": "Set", "key": key, "operations": [{"operation": "replace", "value": value}]}]
546 )
547
548
543func completedGoal(): 549func completedGoal():
544 sendMessage([{"cmd": "StatusUpdate", "status": 30}]) # CLIENT_GOAL 550 sendMessage([{"cmd": "StatusUpdate", "status": 30}]) # CLIENT_GOAL
545 551
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 9568f69..052aa84 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd
@@ -267,12 +267,22 @@ func _load():
267 painting_node.move_to_z = painting_node.translation.z 267 painting_node.move_to_z = painting_node.translation.z
268 painting_node.translation.x = 88 268 painting_node.translation.x = 88
269 painting_node.translation.z = 39 269 painting_node.translation.z = 39
270 270
271 var fearless_door = get_node("Doors/Naps Room Doors/Door_hider_5").duplicate() 271 var fearless_door = get_node("Doors/Naps Room Doors/Door_hider_5").duplicate()
272 fearless_door.name = "Door_hider_new1" 272 fearless_door.name = "Door_hider_new1"
273 fearless_door.translation.y = 5 273 fearless_door.translation.y = 5
274 get_node("Doors/Naps Room Doors").add_child(fearless_door) 274 get_node("Doors/Naps Room Doors").add_child(fearless_door)
275 275
276 # Set up notifiers for each achievement panel, for the tracker.
277 var notifier_script = ResourceLoader.load("user://maps/Archipelago/notifier.gd")
278 for panel in gamedata.panels:
279 if "achievement" in panel:
280 var panel_node = panels_parent.get_node(panel["id"])
281 var script_instance = notifier_script.new()
282 script_instance.name = "Achievement_Notifier"
283 script_instance.key = "Achievement|%s" % panel["achievement"]
284 panel_node.add_child(script_instance)
285
276 # Attach a script to every panel so that we can do things like conditionally 286 # Attach a script to every panel so that we can do things like conditionally
277 # disable them. 287 # disable them.
278 var panel_script = ResourceLoader.load("user://maps/Archipelago/panel.gd") 288 var panel_script = ResourceLoader.load("user://maps/Archipelago/panel.gd")
diff --git a/Archipelago/notifier.gd b/Archipelago/notifier.gd new file mode 100644 index 0000000..57d6564 --- /dev/null +++ b/Archipelago/notifier.gd
@@ -0,0 +1,14 @@
1extends Node
2
3var key
4
5
6func _ready():
7 self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").connect(
8 "answer_correct", self, "handle_correct"
9 )
10
11
12func handle_correct():
13 var apclient = global.get_node("Archipelago")
14 apclient.setValue(key, true)