Make slide switching a bit less verbose

This commit is contained in:
JeremyStar™ 2024-05-18 19:30:33 +02:00
parent 63a5d26639
commit b67f53aca6
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -62,10 +62,8 @@ func _process(_delta: float) -> void:
DisplayServer.WindowMode.WINDOW_MODE_WINDOWED: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_FULLSCREEN) DisplayServer.WindowMode.WINDOW_MODE_WINDOWED: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_FULLSCREEN)
_: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_WINDOWED) _: DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_WINDOWED)
if Input.is_action_just_pressed("navigate_forwards"): if Input.is_action_just_pressed("navigate_forwards"):
logger.diag("Navigating to next slide")
await switch_slide(current_slide + 1) await switch_slide(current_slide + 1)
if Input.is_action_just_pressed("navigate_backwards"): if Input.is_action_just_pressed("navigate_backwards"):
logger.diag("Navigating to previous slide")
await switch_slide(current_slide - 1) await switch_slide(current_slide - 1)
# +++ slide management +++ # +++ slide management +++
@ -106,7 +104,7 @@ func switch_slide(new_slide: int) -> PresencodeTypes.PresencodeError:
return PresencodeTypes.PresencodeError.OK return PresencodeTypes.PresencodeError.OK
func remove_all_slides() -> void: func remove_all_slides() -> void:
logger.verb("Removing all slides") logger.diag("Removing all slides")
for scene in sms.get_scene_collection_list(CoreTypes.SceneType.MAIN): for scene in sms.get_scene_collection_list(CoreTypes.SceneType.MAIN):
sms.remove_scene(scene.name) sms.remove_scene(scene.name)