diff --git a/src/classes/communication.gd b/src/classes/communication.gd index e72b319..2621278 100644 --- a/src/classes/communication.gd +++ b/src/classes/communication.gd @@ -19,21 +19,27 @@ class_name PresencodeCommunication # CORE var core: Core -@onready var logger: CoreLoggerInstance = core.logger.get_instance("src/classes/communication.gd") -@onready var sms: CoreBaseModule = core.sms +var logger: CoreLoggerInstance +var sms: CoreBaseModule # Presencode infrastructure var presenloader: Node # Presentation data -@onready var entrypoint: PresencodeEntrypoint = presenloader.entrypoint_node -@onready var manifest: Dictionary = presenloader.manifest +var entrypoint: PresencodeEntrypoint +var manifest: Dictionary var current_slide: int = -1 # +++ initialization +++ func _init(core_new: Core, presenloader_new: Node) -> void: core = core_new + logger = core.logger.get_instance("src/classes/communication.gd", self) + sms = core.sms + presenloader = presenloader_new + + entrypoint = presenloader.entrypoint_node + manifest = presenloader.manifest # +++ slide management +++ func switch_slide(new_slide: int) -> PresencodeTypes.PresencodeError: diff --git a/src/presenloader.gd b/src/presenloader.gd index b1de701..7707a19 100644 --- a/src/presenloader.gd +++ b/src/presenloader.gd @@ -29,7 +29,7 @@ var manifest: Dictionary = {} var entrypoint: Script = null var entrypoint_node: PresencodeEntrypoint = null -var communication: PresencodeCommunication = PresencodeCommunication.new(core, self) +@onready var communication: PresencodeCommunication = PresencodeCommunication.new(core, self) var reader: ZIPReader = ZIPReader.new() var diraccess: DirAccess = null