From 00ec16e3f3a98339ec7462675fa41b3dd240861b Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 13 Jan 2017 19:36:04 -0300 Subject: [PATCH] renamed tween animationplayer scale functions to speed_scale --- scene/animation/animation_player.cpp | 10 +++++----- scene/animation/animation_player.h | 4 ++-- scene/animation/tween.cpp | 10 +++++----- scene/animation/tween.h | 4 ++-- .../editor/plugins/animation_player_editor_plugin.cpp | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index fa0700584ce..7fc2234d867 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -36,7 +36,7 @@ bool AnimationPlayer::_set(const StringName& p_name, const Variant& p_value) { String name=p_name; if (p_name==SceneStringNames::get_singleton()->playback_speed || p_name==SceneStringNames::get_singleton()->speed) { //bw compatibility - set_speed(p_value); + set_speed_scale(p_value); } else if (p_name==SceneStringNames::get_singleton()->playback_active) { set_active(p_value); @@ -1082,13 +1082,13 @@ void AnimationPlayer::stop_all() { } -void AnimationPlayer::set_speed(float p_speed) { +void AnimationPlayer::set_speed_scale(float p_speed) { speed_scale=p_speed; } -float AnimationPlayer::get_speed() const { +float AnimationPlayer::get_speed_scale() const { return speed_scale; } @@ -1323,8 +1323,8 @@ void AnimationPlayer::_bind_methods() { ClassDB::bind_method(_MD("set_active","active"),&AnimationPlayer::set_active); ClassDB::bind_method(_MD("is_active"),&AnimationPlayer::is_active); - ClassDB::bind_method(_MD("set_speed","speed"),&AnimationPlayer::set_speed); - ClassDB::bind_method(_MD("get_speed"),&AnimationPlayer::get_speed); + ClassDB::bind_method(_MD("set_speed_scale","speed"),&AnimationPlayer::set_speed_scale); + ClassDB::bind_method(_MD("get_speed_scale"),&AnimationPlayer::get_speed_scale); ClassDB::bind_method(_MD("set_autoplay","name"),&AnimationPlayer::set_autoplay); ClassDB::bind_method(_MD("get_autoplay"),&AnimationPlayer::get_autoplay); diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 94955bec606..41bae6c9289 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -271,8 +271,8 @@ public: bool is_active() const; bool is_valid() const; - void set_speed(float p_speed); - float get_speed() const; + void set_speed_scale(float p_speed); + float get_speed_scale() const; void set_autoplay(const String& pname); String get_autoplay() const; diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 62a8286041c..0916119db31 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -109,7 +109,7 @@ bool Tween::_set(const StringName& p_name, const Variant& p_value) { String name=p_name; if (name=="playback/speed" || name=="speed") { //bw compatibility - set_speed(p_value); + set_speed_scale(p_value); } else if (name=="playback/active") { set_active(p_value); @@ -192,8 +192,8 @@ void Tween::_bind_methods() { ClassDB::bind_method(_MD("is_repeat"),&Tween::is_repeat ); ClassDB::bind_method(_MD("set_repeat","repeat"),&Tween::set_repeat ); - ClassDB::bind_method(_MD("set_speed","speed"),&Tween::set_speed); - ClassDB::bind_method(_MD("get_speed"),&Tween::get_speed); + ClassDB::bind_method(_MD("set_speed_scale","speed"),&Tween::set_speed_scale); + ClassDB::bind_method(_MD("get_speed_scale"),&Tween::get_speed_scale); ClassDB::bind_method(_MD("set_tween_process_mode","mode"),&Tween::set_tween_process_mode); ClassDB::bind_method(_MD("get_tween_process_mode"),&Tween::get_tween_process_mode); @@ -697,12 +697,12 @@ void Tween::set_repeat(bool p_repeat) { repeat = p_repeat; } -void Tween::set_speed(float p_speed) { +void Tween::set_speed_scale(float p_speed) { speed_scale=p_speed; } -float Tween::get_speed() const { +float Tween::get_speed_scale() const { return speed_scale; } diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 12c7aa62a10..07c2e90da2f 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -165,8 +165,8 @@ public: void set_tween_process_mode(TweenProcessMode p_mode); TweenProcessMode get_tween_process_mode() const; - void set_speed(float p_speed); - float get_speed() const; + void set_speed_scale(float p_speed); + float get_speed_scale() const; bool start(); bool reset(Object *p_node, String p_key); diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 9850298c67a..6646fea3dbc 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -768,7 +768,7 @@ void AnimationPlayerEditor::_dialog_action(String p_file) { void AnimationPlayerEditor::_scale_changed(const String& p_scale) { - player->set_speed(p_scale.to_double()); + player->set_speed_scale(p_scale.to_double()); } void AnimationPlayerEditor::_update_animation() { @@ -790,7 +790,7 @@ void AnimationPlayerEditor::_update_animation() { stop->set_pressed(true); } - scale->set_text( String::num(player->get_speed(),2) ); + scale->set_text( String::num(player->get_speed_scale(),2) ); String current=player->get_current_animation(); for (int i=0;iget_item_count();i++) {