diff --git a/scene/notification/notification.gd b/scene/notification/notification.gd index d401d33c..a6462d06 100644 --- a/scene/notification/notification.gd +++ b/scene/notification/notification.gd @@ -38,15 +38,18 @@ func show_center_texture(texture, duration := 3.0): tween.tween_interval(max(0.1, duration - 0.8)) tween.tween_property(center_texture, "modulate:a", 0, 0.4) +var center_notification_tween: Tween func show_center_notification(msg, duration := 3.0): if not top_center_label: return top_center_label.text = msg - var tween = create_tween() - tween.tween_property(top_center_label, "modulate:a", 1, 0.4) - tween.tween_interval(max(0.1, duration - 0.8)) - tween.tween_property(top_center_label, "modulate:a", 0, 0.4) + if center_notification_tween and center_notification_tween.is_running(): + center_notification_tween.kill() + center_notification_tween = create_tween() + center_notification_tween.tween_property(top_center_label, "modulate:a", 1, 0.4) + center_notification_tween.tween_interval(max(0.1, duration - 0.8)) + center_notification_tween.tween_property(top_center_label, "modulate:a", 0, 0.4) func show_notification(msg, number):