Add remove_all_slides() method
This commit is contained in:
parent
0dada10659
commit
fdab9ca0a3
1 changed files with 10 additions and 0 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
|
||||
|
|
Loading…
Reference in a new issue