Fix: Tween always return true for _get(), _set()

(cherry picked from commit 2811268231)
This commit is contained in:
Thakee Nathees 2020-05-05 16:32:33 +05:30 committed by Rémi Verschelde
parent 918f5dee23
commit a5a28239a6
1 changed files with 8 additions and 2 deletions

View File

@ -126,15 +126,18 @@ bool Tween::_set(const StringName &p_name, const Variant &p_value) {
String name = p_name; String name = p_name;
if (name == "playback/speed" || name == "speed") { // Backwards compatibility if (name == "playback/speed" || name == "speed") { // Backwards compatibility
set_speed_scale(p_value); set_speed_scale(p_value);
return true;
} else if (name == "playback/active") { } else if (name == "playback/active") {
set_active(p_value); set_active(p_value);
return true;
} else if (name == "playback/repeat") { } else if (name == "playback/repeat") {
set_repeat(p_value); set_repeat(p_value);
}
return true; return true;
} }
return false;
}
bool Tween::_get(const StringName &p_name, Variant &r_ret) const { bool Tween::_get(const StringName &p_name, Variant &r_ret) const {
@ -142,15 +145,18 @@ bool Tween::_get(const StringName &p_name, Variant &r_ret) const {
String name = p_name; String name = p_name;
if (name == "playback/speed") { // Backwards compatibility if (name == "playback/speed") { // Backwards compatibility
r_ret = speed_scale; r_ret = speed_scale;
return true;
} else if (name == "playback/active") { } else if (name == "playback/active") {
r_ret = is_active(); r_ret = is_active();
return true;
} else if (name == "playback/repeat") { } else if (name == "playback/repeat") {
r_ret = is_repeat(); r_ret = is_repeat();
}
return true; return true;
} }
return false;
}
void Tween::_get_property_list(List<PropertyInfo> *p_list) const { void Tween::_get_property_list(List<PropertyInfo> *p_list) const {
// Add the property info for the Tween object // Add the property info for the Tween object