Fix errors

This commit is contained in:
JeremyStar™ 2024-05-17 01:50:07 +02:00
parent 126ca9f412
commit 78b85fca1b
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 11 additions and 2 deletions

View file

@ -52,6 +52,9 @@ func _process(_delta: float) -> void:
switch_slide(current_slide + 1) switch_slide(current_slide + 1)
if Input.is_action_just_pressed("navigate_backwards"): if Input.is_action_just_pressed("navigate_backwards"):
switch_slide(current_slide - 1) switch_slide(current_slide - 1)
func _update_variables() -> void:
logger.diag("Updating variables")
entrypoint = presenloader.entrypoint_node entrypoint = presenloader.entrypoint_node
manifest = presenloader.manifest manifest = presenloader.manifest

View file

@ -37,6 +37,9 @@ var diraccess: DirAccess = null
func _ready() -> void: func _ready() -> void:
# Register cleanup hook # Register cleanup hook
core.register_cleanup_hook(func() -> void: queue_free()) core.register_cleanup_hook(func() -> void: queue_free())
# Add 'communication' as a child
add_child(communication)
func load_presentation(load_path: String) -> String: func load_presentation(load_path: String) -> String:
logger.info(core.misc.stringify_variables("Loading presentation located at %path%", { "path": load_path })) logger.info(core.misc.stringify_variables("Loading presentation located at %path%", { "path": load_path }))
@ -90,6 +93,9 @@ func load_presentation(load_path: String) -> String:
# Inject entrypoint # Inject entrypoint
inject_entrypoint() inject_entrypoint()
# Update 'communication''s variables
communication._update_variables()
return "" return ""
func check_required_files() -> String: func check_required_files() -> String:
@ -233,10 +239,10 @@ func inject_entrypoint() -> void:
entrypoint_node.api = communication entrypoint_node.api = communication
# Add to SceneTree # Add to SceneTree
get_tree().root.add_child(entrypoint_node) get_tree().root.add_child.call_deferred(entrypoint_node)
# Execute initialize() # Execute initialize()
await entrypoint_node.initialize() entrypoint_node.initialize.call_deferred()
# +++ etc +++ # +++ etc +++
func write_temporary_file(bytes: PackedByteArray) -> void: func write_temporary_file(bytes: PackedByteArray) -> void: