Revert "Tween reset/stop/resume/remove for all object properties at once"

This reverts commit 6fc894d652.
It caused a regression, cf. #6863.
This commit is contained in:
Rémi Verschelde 2016-10-18 21:43:46 +02:00
parent 7d25d20861
commit 14e45a55d4
2 changed files with 18 additions and 21 deletions

View file

@ -43252,10 +43252,10 @@
</return> </return>
<argument index="0" name="object" type="Object"> <argument index="0" name="object" type="Object">
</argument> </argument>
<argument index="1" name="key" type="String" default="&quot;&quot;"> <argument index="1" name="key" type="String">
</argument> </argument>
<description> <description>
Stop animating and completely remove a tween, given its object and property/method pair. Passing empty String as key will remove all tweens for given object. Stop animating and completely remove a tween, given its object and property/method pair.
</description> </description>
</method> </method>
<method name="remove_all"> <method name="remove_all">
@ -43270,10 +43270,10 @@
</return> </return>
<argument index="0" name="object" type="Object"> <argument index="0" name="object" type="Object">
</argument> </argument>
<argument index="1" name="key" type="String" default="&quot;&quot;"> <argument index="1" name="key" type="String">
</argument> </argument>
<description> <description>
Resets a tween to the initial value (the one given, not the one before the tween), given its object and property/method pair. Passing empty String as key will reset all tweens for given object. Resets a tween to the initial value (the one given, not the one before the tween), given its object and property/method pair.
</description> </description>
</method> </method>
<method name="reset_all"> <method name="reset_all">
@ -43288,10 +43288,10 @@
</return> </return>
<argument index="0" name="object" type="Object"> <argument index="0" name="object" type="Object">
</argument> </argument>
<argument index="1" name="key" type="String" default="&quot;&quot;"> <argument index="1" name="key" type="String">
</argument> </argument>
<description> <description>
Continue animating a stopped tween, given its object and property/method pair. Passing empty String as key will resume all tweens for given object. Continue animating a stopped tween, given its object and property/method pair.
</description> </description>
</method> </method>
<method name="resume_all"> <method name="resume_all">
@ -43350,10 +43350,10 @@
</return> </return>
<argument index="0" name="object" type="Object"> <argument index="0" name="object" type="Object">
</argument> </argument>
<argument index="1" name="key" type="String" default="&quot;&quot;"> <argument index="1" name="key" type="String">
</argument> </argument>
<description> <description>
Stop animating a tween, given its object and property/method pair. Passing empty String as key will stop all tweens for given object. Stop animating a tween, given its object and property/method pair.
</description> </description>
</method> </method>
<method name="stop_all"> <method name="stop_all">

View file

@ -199,13 +199,13 @@ void Tween::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_tween_process_mode"),&Tween::get_tween_process_mode); ObjectTypeDB::bind_method(_MD("get_tween_process_mode"),&Tween::get_tween_process_mode);
ObjectTypeDB::bind_method(_MD("start"),&Tween::start ); ObjectTypeDB::bind_method(_MD("start"),&Tween::start );
ObjectTypeDB::bind_method(_MD("reset","object","key"),&Tween::reset, DEFVAL("") ); ObjectTypeDB::bind_method(_MD("reset","object","key"),&Tween::reset );
ObjectTypeDB::bind_method(_MD("reset_all"),&Tween::reset_all ); ObjectTypeDB::bind_method(_MD("reset_all"),&Tween::reset_all );
ObjectTypeDB::bind_method(_MD("stop","object","key"),&Tween::stop, DEFVAL("") ); ObjectTypeDB::bind_method(_MD("stop","object","key"),&Tween::stop );
ObjectTypeDB::bind_method(_MD("stop_all"),&Tween::stop_all ); ObjectTypeDB::bind_method(_MD("stop_all"),&Tween::stop_all );
ObjectTypeDB::bind_method(_MD("resume","object","key"),&Tween::resume, DEFVAL("") ); ObjectTypeDB::bind_method(_MD("resume","object","key"),&Tween::resume );
ObjectTypeDB::bind_method(_MD("resume_all"),&Tween::resume_all ); ObjectTypeDB::bind_method(_MD("resume_all"),&Tween::resume_all );
ObjectTypeDB::bind_method(_MD("remove","object","key"),&Tween::remove, DEFVAL("") ); ObjectTypeDB::bind_method(_MD("remove","object","key"),&Tween::remove );
ObjectTypeDB::bind_method(_MD("remove_all"),&Tween::remove_all ); ObjectTypeDB::bind_method(_MD("remove_all"),&Tween::remove_all );
ObjectTypeDB::bind_method(_MD("seek","time"),&Tween::seek ); ObjectTypeDB::bind_method(_MD("seek","time"),&Tween::seek );
ObjectTypeDB::bind_method(_MD("tell"),&Tween::tell ); ObjectTypeDB::bind_method(_MD("tell"),&Tween::tell );
@ -723,7 +723,7 @@ bool Tween::reset(Object *p_object, String p_key) {
if(object == NULL) if(object == NULL)
continue; continue;
if(object == p_object && (data.key == p_key || p_key == "")) { if(object == p_object && data.key == p_key) {
data.elapsed = 0; data.elapsed = 0;
data.finish = false; data.finish = false;
@ -759,7 +759,7 @@ bool Tween::stop(Object *p_object, String p_key) {
Object *object = ObjectDB::get_instance(data.id); Object *object = ObjectDB::get_instance(data.id);
if(object == NULL) if(object == NULL)
continue; continue;
if(object == p_object && (data.key == p_key || p_key == "")) if(object == p_object && data.key == p_key)
data.active = false; data.active = false;
} }
pending_update --; pending_update --;
@ -793,7 +793,7 @@ bool Tween::resume(Object *p_object, String p_key) {
Object *object = ObjectDB::get_instance(data.id); Object *object = ObjectDB::get_instance(data.id);
if(object == NULL) if(object == NULL)
continue; continue;
if(object == p_object && (data.key == p_key || p_key == "")) if(object == p_object && data.key == p_key)
data.active = true; data.active = true;
} }
pending_update --; pending_update --;
@ -821,20 +821,17 @@ bool Tween::remove(Object *p_object, String p_key) {
call_deferred("remove", p_object, p_key); call_deferred("remove", p_object, p_key);
return true; return true;
} }
List<List<InterpolateData>::Element *> for_removal;
for(List<InterpolateData>::Element *E=interpolates.front();E;E=E->next()) { for(List<InterpolateData>::Element *E=interpolates.front();E;E=E->next()) {
InterpolateData& data = E->get(); InterpolateData& data = E->get();
Object *object = ObjectDB::get_instance(data.id); Object *object = ObjectDB::get_instance(data.id);
if(object == NULL) if(object == NULL)
continue; continue;
if(object == p_object && (data.key == p_key || p_key == "")) { if(object == p_object && data.key == p_key) {
for_removal.push_back(E); interpolates.erase(E);
return true;
} }
} }
for(List<List<InterpolateData>::Element *>::Element *E=for_removal.front();E;E=E->next()) {
interpolates.erase(E->get());
}
return true; return true;
} }