Skip to content

Commit

Permalink
Merge pull request #2933 from Poobslag/scene-transition-logging
Browse files Browse the repository at this point in the history
Added additional scene transition/breadcrumb logging
  • Loading branch information
Poobslag authored Nov 27, 2024
2 parents 5f950f1 + f1d81dc commit f6c5303
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions project/src/main/ui/scene-transition.gd
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func fade_out(flags: Dictionary = {}, breadcrumb_method: FuncRef = null, breadcr
if _animation_player.is_connected(
"animation_finished", self, "_on_AnimationPlayer_animation_finished_change_scene"):
_animation_player.disconnect("animation_finished", self, "_on_AnimationPlayer_animation_finished_change_scene")

_animation_player.connect("animation_finished", self, "_on_AnimationPlayer_animation_finished_change_scene", \
[flags, breadcrumb_method, breadcrumb_arg_array])
emit_signal("fade_out_started", _fade_out_duration(flags))
Expand All @@ -143,10 +144,15 @@ func _fade_in_duration(flags: Dictionary) -> float:
func _on_AnimationPlayer_animation_finished_change_scene(
_animation_name: String, flags: Dictionary = {}, breadcrumb_method: FuncRef = null,
breadcrumb_arg_array: Array = []) -> void:
Global.print_verbose("Animation finished; disconnecting listeners")
if _animation_player.is_connected(
"animation_finished", self, "_on_AnimationPlayer_animation_finished_change_scene"):
_animation_player.disconnect("animation_finished", self, "_on_AnimationPlayer_animation_finished_change_scene")

if breadcrumb_method:
Global.print_verbose("Calling breadcrumb method: %s, %s" % [breadcrumb_method.function, breadcrumb_arg_array])
breadcrumb_method.call_funcv(breadcrumb_arg_array)
else:
Global.print_verbose("No breadcrumb method: %s, %s" % [breadcrumb_method, breadcrumb_arg_array])

call_deferred("fade_in", flags)

0 comments on commit f6c5303

Please sign in to comment.