You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
fix no tween repeat after stop_all() and start() again
This commit is contained in:
@@ -869,8 +869,21 @@ void Tween::start() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pending_update++;
|
||||||
|
for (List<InterpolateData>::Element *E = interpolates.front(); E; E = E->next()) {
|
||||||
|
InterpolateData &data = E->get();
|
||||||
|
data.active = true;
|
||||||
|
}
|
||||||
|
pending_update--;
|
||||||
|
|
||||||
// We want to be activated
|
// We want to be activated
|
||||||
set_active(true);
|
set_active(true);
|
||||||
|
|
||||||
|
// Don't resume from current position if stop_all() function has been used
|
||||||
|
if (was_stopped) {
|
||||||
|
seek(0);
|
||||||
|
}
|
||||||
|
was_stopped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tween::reset(Object *p_object, StringName p_key) {
|
void Tween::reset(Object *p_object, StringName p_key) {
|
||||||
@@ -939,7 +952,7 @@ void Tween::stop(Object *p_object, StringName p_key) {
|
|||||||
void Tween::stop_all() {
|
void Tween::stop_all() {
|
||||||
// We no longer need to be active since all tweens have been stopped
|
// We no longer need to be active since all tweens have been stopped
|
||||||
set_active(false);
|
set_active(false);
|
||||||
|
was_stopped = true;
|
||||||
// For each interpolation...
|
// For each interpolation...
|
||||||
pending_update++;
|
pending_update++;
|
||||||
for (List<InterpolateData>::Element *E = interpolates.front(); E; E = E->next()) {
|
for (List<InterpolateData>::Element *E = interpolates.front(); E; E = E->next()) {
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ private:
|
|||||||
float speed_scale = 1.0;
|
float speed_scale = 1.0;
|
||||||
mutable int pending_update = 0;
|
mutable int pending_update = 0;
|
||||||
int uid = 0;
|
int uid = 0;
|
||||||
|
bool was_stopped = false;
|
||||||
|
|
||||||
List<InterpolateData> interpolates;
|
List<InterpolateData> interpolates;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user