Add remove_all_slides() method

This commit is contained in:
JeremyStar™ 2024-05-14 00:43:21 +02:00
parent 0dada10659
commit fdab9ca0a3
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

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