find_package(Protobuf REQUIRED) add_library(protos) protobuf_generate( LANGUAGE cpp TARGET protos PROTOS human.proto data.proto ) target_link_libraries(protos PUBLIC protobuf::libprotobuf) rnate' title='Atom feed' href='https://code.fourisland.com/lingo2-archipelago/atom/apworld/client/keyHolderChecker.gd?h=loc-refactor' type='application/atom+xml'/>
about summary refs log tree commit diff stats
path: root/apworld/client/keyHolderChecker.gd
blob: a75a9e455d3447ac1332493e3a5303cf7c0bf259 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extends "res://scripts/nodes/listeners/keyHolderChecker.gd"


func check():
	var ap = global.get_node("Archipelago")
	var matches = []
	for map in ap.keyboard.keyholder_state.keys():
		var nodes = ap.keyboard.keyholder_state[map]
		for node in nodes.keys():
			matches.append([nodes[node], 1, map, "/root/scene/%s" % node])

	var count = 0
	for key_match in matches:
		var active = (
			key_match[2] + String(key_match[3]).replace("/root/scene/Components/KeyHolders/", ".")
		)
		if map[active] == key_match[0]:
			emit_signal("trigger_letter", key_match[0], true)
			count += 1
		else:
			emit_signal("trigger_letter", key_match[0], false)

	if count > 25:
		emit_signal("trigger")