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,22 +19,28 @@ class_name PresencodeCommunication
# CORE # CORE
var core: Core var core: Core
@onready var logger: CoreLoggerInstance = core.logger.get_instance("src/classes/communication.gd") var logger: CoreLoggerInstance
@onready var sms: CoreBaseModule = core.sms var sms: CoreBaseModule
# Presencode infrastructure # Presencode infrastructure
var presenloader: Node var presenloader: Node
# Presentation data # Presentation data
@onready var entrypoint: PresencodeEntrypoint = presenloader.entrypoint_node var entrypoint: PresencodeEntrypoint
@onready var manifest: Dictionary = presenloader.manifest var manifest: Dictionary
var current_slide: int = -1 var current_slide: int = -1
# +++ initialization +++ # +++ initialization +++
func _init(core_new: Core, presenloader_new: Node) -> void: func _init(core_new: Core, presenloader_new: Node) -> void:
core = core_new core = core_new
logger = core.logger.get_instance("src/classes/communication.gd", self)
sms = core.sms
presenloader = presenloader_new presenloader = presenloader_new
entrypoint = presenloader.entrypoint_node
manifest = presenloader.manifest
# +++ slide management +++ # +++ slide management +++
func switch_slide(new_slide: int) -> PresencodeTypes.PresencodeError: func switch_slide(new_slide: int) -> PresencodeTypes.PresencodeError:
var old_slide: int = current_slide var old_slide: int = current_slide

View file

@ -29,7 +29,7 @@ var manifest: Dictionary = {}
var entrypoint: Script = null var entrypoint: Script = null
var entrypoint_node: PresencodeEntrypoint = 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 reader: ZIPReader = ZIPReader.new()
var diraccess: DirAccess = null var diraccess: DirAccess = null