|
@@ -3,6 +3,8 @@ extends Node2D
|
|
# Manage slide cycling
|
|
# Manage slide cycling
|
|
|
|
|
|
|
|
|
|
|
|
+signal end_reached
|
|
|
|
+
|
|
const VOID_SLIDE_ID := -1
|
|
const VOID_SLIDE_ID := -1
|
|
|
|
|
|
@export_group("Slide management")
|
|
@export_group("Slide management")
|
|
@@ -17,6 +19,7 @@ const VOID_SLIDE_ID := -1
|
|
|
|
|
|
@export_group("Export")
|
|
@export_group("Export")
|
|
@export var one_slide_per_frame := true
|
|
@export var one_slide_per_frame := true
|
|
|
|
+@export var quit_after_last_slide := true
|
|
|
|
|
|
var current_id := VOID_SLIDE_ID
|
|
var current_id := VOID_SLIDE_ID
|
|
var current_slide: Slide
|
|
var current_slide: Slide
|
|
@@ -37,6 +40,7 @@ func _ready() -> void:
|
|
_global_slide_setup()
|
|
_global_slide_setup()
|
|
|
|
|
|
if auto_next_slide:
|
|
if auto_next_slide:
|
|
|
|
+ end_reached.connect(get_tree().quit)
|
|
return
|
|
return
|
|
|
|
|
|
go_slowly_to_next_slide()
|
|
go_slowly_to_next_slide()
|
|
@@ -65,8 +69,13 @@ func next_slide(trans: Focus.Transit) -> void:
|
|
|
|
|
|
func next_slide_at(next_id: int, trans: Focus.Transit) -> void:
|
|
func next_slide_at(next_id: int, trans: Focus.Transit) -> void:
|
|
_disable_current_slide()
|
|
_disable_current_slide()
|
|
|
|
+
|
|
current_id = next_id
|
|
current_id = next_id
|
|
current_slide = _focus_slide(current_id, trans)
|
|
current_slide = _focus_slide(current_id, trans)
|
|
|
|
+
|
|
|
|
+ if is_last_slide():
|
|
|
|
+ end_reached.emit()
|
|
|
|
+
|
|
_enable_current_slide()
|
|
_enable_current_slide()
|
|
|
|
|
|
|
|
|