diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-25 14:14:22 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-25 14:14:22 -0400 |
| commit | cb2eca4fed1eb3692eaa13715f65ebcaf8472b64 (patch) | |
| tree | 7d11ad1db462c0af4de9da02bde8e44899e0e282 /apworld/client/source_runtime.gd | |
| parent | 72b9d1f0952aee6e72b9478118dc99e08ff1fa54 (diff) | |
| download | lingo2-archipelago-cb2eca4fed1eb3692eaa13715f65ebcaf8472b64.tar.gz lingo2-archipelago-cb2eca4fed1eb3692eaa13715f65ebcaf8472b64.tar.bz2 lingo2-archipelago-cb2eca4fed1eb3692eaa13715f65ebcaf8472b64.zip | |
Client can be run from zipped apworld now
Diffstat (limited to 'apworld/client/source_runtime.gd')
| -rw-r--r-- | apworld/client/source_runtime.gd | 16 |
1 files changed, 15 insertions, 1 deletions
| diff --git a/apworld/client/source_runtime.gd b/apworld/client/source_runtime.gd index fbb7009..35428ea 100644 --- a/apworld/client/source_runtime.gd +++ b/apworld/client/source_runtime.gd | |||
| @@ -7,9 +7,23 @@ func _init(path): | |||
| 7 | source_path = path | 7 | source_path = path |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | func load_path(path): | 10 | func load_script(path): |
| 11 | return ResourceLoader.load("%s/%s" % [source_path, path]) | 11 | return ResourceLoader.load("%s/%s" % [source_path, path]) |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | func read_path(path): | 14 | func read_path(path): |
| 15 | return FileAccess.get_file_as_bytes("%s/%s" % [source_path, path]) | 15 | return FileAccess.get_file_as_bytes("%s/%s" % [source_path, path]) |
| 16 | |||
| 17 | |||
| 18 | func load_script_as_scene(path, scene_name): | ||
| 19 | var script = load_script(path) | ||
| 20 | var instance = script.new() | ||
| 21 | instance.name = scene_name | ||
| 22 | |||
| 23 | get_tree().unload_current_scene() | ||
| 24 | _load_scene.call_deferred(instance) | ||
| 25 | |||
| 26 | |||
| 27 | func _load_scene(instance): | ||
| 28 | get_tree().get_root().add_child(instance) | ||
| 29 | get_tree().current_scene = instance | ||
