Fix variables in communication.gd

This commit is contained in:
JeremyStar™ 2024-05-14 01:29:35 +02:00
parent b24d3935f8
commit 9b216c61ef
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 11 additions and 5 deletions

View file

@ -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:

View file

@ -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