renamed tween animationplayer scale functions to speed_scale

This commit is contained in:
Juan Linietsky 2017-01-13 19:36:04 -03:00
parent a97551902e
commit 00ec16e3f3
5 changed files with 16 additions and 16 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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;
}

View file

@ -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);

View file

@ -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;i<animation->get_item_count();i++) {