Add Tween::has_tweeners()#92429
Conversation
d9549ae to
28f02cc
Compare
28f02cc to
951df8e
Compare
951df8e to
71eae05
Compare
71eae05 to
741ea10
Compare
741ea10 to
8915b2f
Compare
8915b2f to
86e6f89
Compare
86e6f89 to
e779320
Compare
I think this should be mentioned in the description, possibly with some simple code sample. Although I'm not sure how exactly is that useful. The "Tween has no Tweeners" error is most often a result of a mistake. If you add a code to safeguard against it, you might as well ensure that your logic can't lead to such situation. Unless it's meant for code that conditionally adds Tweeners and empty Tween is an expected result? |
This is my case. Create one tween only and pass it to multiple objects, each object adds tweener conditionally. |
ce08510 to
cc645c6
Compare
There was a problem hiding this comment.
Why does it mention tween validity if it's not checked? (the valid variable)
Also the second sentence likely needs rewording, because it's a bit unclear.
There was a problem hiding this comment.
Why does it mention tween validity if it's not checked? (the
validvariable)
This description is changed multiple time, the mention about validity seems redundant now.
Also the second sentence likely needs rewording, because it's a bit unclear.
To be honest, my English is terrible. Could you provide a suitable description to help me?
There was a problem hiding this comment.
| Returns [code]true[/code] if any [Tweener] has been added and the tween is valid. Useful for avoiding print an error by checking and killing the [Tween] if it has not tweeners before it is stepped by [SceneTree]. | |
| Returns [code]true[/code] if any [Tweener] has been added to the tween. Useful when tweeners are added dynamically and the tween can end up empty. Killing an empty tween before it starts will prevent errors. |
There was a problem hiding this comment.
Wait, the validation description is can not removed.
Event if the tween has been added twenners, the vector tweeners will be cleared with valid variable, too.
@KoBeWi please check again.
cc645c6 to
11543c4
Compare
11543c4 to
5809a67
Compare
|
Thanks! |
|
I believe this should close godotengine/godot-proposals#13266 . There is discussion on that thread about use cases that this PR wouldn't cover, but I think those can be addressed with a separate proposal. |
Add
Tween::has_tweeners().So we can check and kill a tween if it has not contains any tweener before it step by scene tree and avoid print an error.