summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/2d/animated_sprite.cpp4
-rw-r--r--scene/animation/animation_player.cpp4
-rw-r--r--scene/scene_string_names.cpp1
-rw-r--r--scene/scene_string_names.h1
4 files changed, 6 insertions, 4 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index f9f6525686..97c23f3a46 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -363,7 +363,7 @@ void AnimatedSprite::_notification(int p_what) {
} else {
frame++;
if (frame==fc-1) {
- emit_signal(SceneStringNames::get_singleton()->finished);
+ emit_signal(SceneStringNames::get_singleton()->animation_finished);
}
}
@@ -685,7 +685,7 @@ void AnimatedSprite::_bind_methods() {
ClassDB::bind_method(_MD("_res_changed"),&AnimatedSprite::_res_changed);
ADD_SIGNAL(MethodInfo("frame_changed"));
- ADD_SIGNAL(MethodInfo("finished"));
+ ADD_SIGNAL(MethodInfo("animation_finished"));
ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "frames",PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), _SCS("set_sprite_frames"),_SCS("get_sprite_frames"));
ADD_PROPERTY( PropertyInfo( Variant::STRING, "animation"), _SCS("set_animation"),_SCS("get_animation"));
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 97efb26753..253c643b98 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -733,7 +733,7 @@ void AnimationPlayer::_animation_process(float p_delta) {
playing = false;
_set_process(false);
end_notify=false;
- emit_signal(SceneStringNames::get_singleton()->finished);
+ emit_signal(SceneStringNames::get_singleton()->animation_finished,playback.assigned);
}
}
@@ -1353,7 +1353,7 @@ void AnimationPlayer::_bind_methods() {
ADD_PROPERTY( PropertyInfo( Variant::REAL, "playback_default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), _SCS("set_default_blend_time"), _SCS("get_default_blend_time"));
ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "root_node"), _SCS("set_root"), _SCS("get_root"));
- ADD_SIGNAL( MethodInfo("finished") );
+ ADD_SIGNAL( MethodInfo("animation_finished", PropertyInfo(Variant::STRING,"name")) );
ADD_SIGNAL( MethodInfo("animation_changed", PropertyInfo(Variant::STRING,"old_name"), PropertyInfo(Variant::STRING,"new_name")) );
ADD_SIGNAL( MethodInfo("animation_started", PropertyInfo(Variant::STRING,"name")) );
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index 3c420626cf..8e7ca882a4 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -51,6 +51,7 @@ SceneStringNames::SceneStringNames() {
sleeping_state_changed=StaticCString::create("sleeping_state_changed");
finished=StaticCString::create("finished");
+ animation_finished=StaticCString::create("animation_finished");
animation_changed=StaticCString::create("animation_changed");
animation_started=StaticCString::create("animation_started");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index a73f40ac7c..5befaa2b69 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -80,6 +80,7 @@ public:
StringName sort_children;
StringName finished;
+ StringName animation_finished;
StringName animation_changed;
StringName animation_started;