From 4d2d82b199a3217e6a67072cba263012e0dbced3 Mon Sep 17 00:00:00 2001 From: blujai831 Date: Sat, 6 Jan 2024 19:16:28 -0800 Subject: [PATCH] Added factory functions for TweenChannel because 'TweenChannel.new(TweenChannel.ArbitrationMode.REPLACE)' is kind of tedious to write. --- util/TweenChannel.gd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/TweenChannel.gd b/util/TweenChannel.gd index da1471c..ad727c0 100644 --- a/util/TweenChannel.gd +++ b/util/TweenChannel.gd @@ -29,6 +29,18 @@ func _init( ) -> void: arbitration_mode = p_arbitration_mode +## Creates a TweenChannel which arbitrates by yielding. +static func make_yielding() -> TweenChannel: + return new(ArbitrationMode.YIELD) + +## Creates a TweenChannel which arbitrates by replacing. +static func make_replacing() -> TweenChannel: + return new(ArbitrationMode.REPLACE) + +## Creates a TweenChannel which arbitrates by ignoring. +static func make_ignoring() -> TweenChannel: + return new(ArbitrationMode.IGNORE) + ## Returns target.create_tween() if and when arbitration_mode allows. ## ## "If:" if arbitration_mode is IGNORE and there is a current tween,