extends Node
var apworld_reader
func _init(path):
apworld_reader = ZIPReader.new()
apworld_reader.open(path)
func _get_true_path(path):
if path.begins_with("../"):
return "lingo2/%s" % path.substr(3)
else:
return "lingo2/client/%s" % path
func load_script(path):
var true_path = _get_true_path(path)
var script = GDScript.new()
script.source_code = apworld_reader.read_file(true_path).get_string_from_utf8()
script.reload()
return script
func read_path(path):
var true_path = _get_true_path(path)
return apworld_reader.read_file(true_path)
func load_script_as_scene(path, scene_name):
var script = load_script(path)
var instance = script.new()
instance.name = scene_name
get_tree().unload_current_scene()
_load_scene.call_deferred(instance)
func _load_scene(instance):
get_tree().get_root().add_child(instance)
get_tree().current_scene = instance
value='4bfc938293e8a2122d97cf58cdd433cf90096e56'>this commit
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")
|