|
@@ -8,7 +8,7 @@ signal finished
|
|
|
@export var always_visible: bool = false
|
|
|
|
|
|
@export_group("Processing management", "processing_")
|
|
|
-@export var processing_start_when_enabled := true ## Start processing when focused
|
|
|
+@export var processing_start_when_enabled := true ## Override processing when focused
|
|
|
@export var processing_keep_when_disabled := false ## Enable to process at startup and keep processing after transitioning to another slide
|
|
|
|
|
|
var action_finish := "ui_accept"
|
|
@@ -25,7 +25,7 @@ func disable() -> void:
|
|
|
|
|
|
if processing_keep_when_disabled:
|
|
|
return
|
|
|
- every_children().all(disable_processing)
|
|
|
+ get_children().all(disable_processing)
|
|
|
|
|
|
|
|
|
func enable() -> void:
|
|
@@ -33,7 +33,7 @@ func enable() -> void:
|
|
|
set_process_unhandled_key_input(true)
|
|
|
|
|
|
if processing_start_when_enabled:
|
|
|
- every_children().all(enable_processing)
|
|
|
+ get_children().all(enable_processing)
|
|
|
|
|
|
|
|
|
func get_center() -> Vector2:
|
|
@@ -51,11 +51,6 @@ func set_action_finish(action_name: String) -> void:
|
|
|
action_finish = action_name
|
|
|
|
|
|
|
|
|
-## Return every children recursively
|
|
|
-func every_children() -> Array[Node]:
|
|
|
- return find_children("*", "", true)
|
|
|
-
|
|
|
-
|
|
|
func _unhandled_key_input(event: InputEvent) -> void:
|
|
|
if event.is_action(action_finish) and event.is_pressed():
|
|
|
finished.emit()
|
|
@@ -69,10 +64,10 @@ func _compute_center_offset() -> Vector2:
|
|
|
|
|
|
|
|
|
static func enable_processing(node: Node) -> bool:
|
|
|
- node.set_process(true)
|
|
|
+ node.set_process_mode(Node.PROCESS_MODE_PAUSABLE)
|
|
|
return true # to make it work with Array.all()
|
|
|
|
|
|
|
|
|
static func disable_processing(node: Node) -> bool:
|
|
|
- node.set_process(false)
|
|
|
+ node.set_process_mode(Node.PROCESS_MODE_DISABLED)
|
|
|
return true # to make it work with Array.all()
|