Explorar el Código

:tada: [export] Quit when all slides are exported

DricomDragon hace 2 meses
padre
commit
421218b1c6
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      godot/addons/slide_show/projector/show/Show.gd

+ 9 - 0
godot/addons/slide_show/projector/show/Show.gd

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