Compare commits
2 commits
294f5f188d
...
fdab9ca0a3
Author | SHA1 | Date | |
---|---|---|---|
fdab9ca0a3 | |||
0dada10659 |
2 changed files with 11 additions and 1 deletions
|
@ -20,6 +20,7 @@ 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
|
||||
|
||||
# Presencode infrastructure
|
||||
var presenloader: Node
|
||||
|
@ -29,10 +30,12 @@ var presenloader: Node
|
|||
@onready var manifest: Dictionary = presenloader.manifest
|
||||
var current_slide: int = -1
|
||||
|
||||
# +++ initialization +++
|
||||
func _init(core_new: Core, presenloader_new: Node) -> void:
|
||||
core = core_new
|
||||
presenloader = presenloader_new
|
||||
|
||||
# +++ slide management +++
|
||||
func switch_slide(new_slide: int) -> PresencodeTypes.PresencodeError:
|
||||
var old_slide: int = current_slide
|
||||
|
||||
|
@ -61,5 +64,12 @@ func switch_slide(new_slide: int) -> PresencodeTypes.PresencodeError:
|
|||
|
||||
return PresencodeTypes.PresencodeError.OK
|
||||
|
||||
func remove_all_slides() -> void:
|
||||
logger.verb("Removing all slides")
|
||||
|
||||
for scene in sms.get_scene_collection_list(CoreTypes.SceneType.MAIN):
|
||||
sms.remove_scene(scene.name)
|
||||
|
||||
# +++ etc +++
|
||||
func get_source_path(path: String) -> String:
|
||||
return "<presentation root>/" + path
|
||||
|
|
|
@ -241,7 +241,7 @@ func inject_entrypoint() -> void:
|
|||
# Update variables
|
||||
entrypoint_node.core = core
|
||||
entrypoint_node.logger = core.logger.get_instance(communication.get_source_path("src/" + manifest["entrypoint"]), entrypoint_node)
|
||||
entrypoint_node.communication = communication
|
||||
entrypoint_node.api = communication
|
||||
|
||||
# Add to SceneTree
|
||||
get_tree().root.add_child(entrypoint_node)
|
||||
|
|
Loading…
Reference in a new issue