Add shorthand for using singleton string names
This commit is contained in:
@@ -41,7 +41,7 @@ bool AnimationPlayer::_set(const StringName &p_name, const Variant &p_value) {
|
||||
} else if (name.begins_with("next/")) {
|
||||
String which = name.get_slicec('/', 1);
|
||||
animation_set_next(which, p_value);
|
||||
} else if (p_name == SceneStringNames::get_singleton()->blend_times) {
|
||||
} else if (p_name == SceneStringName(blend_times)) {
|
||||
Array array = p_value;
|
||||
int len = array.size();
|
||||
ERR_FAIL_COND_V(len % 3, false);
|
||||
@@ -326,14 +326,14 @@ void AnimationPlayer::_blend_post_process() {
|
||||
String new_name = playback.assigned;
|
||||
playback_queue.pop_front();
|
||||
if (end_notify) {
|
||||
emit_signal(SceneStringNames::get_singleton()->animation_changed, old, new_name);
|
||||
emit_signal(SceneStringName(animation_changed), old, new_name);
|
||||
}
|
||||
} else {
|
||||
_clear_caches();
|
||||
playing = false;
|
||||
_set_process(false);
|
||||
if (end_notify) {
|
||||
emit_signal(SceneStringNames::get_singleton()->animation_finished, playback.assigned);
|
||||
emit_signal(SceneStringName(animation_finished), playback.assigned);
|
||||
if (movie_quit_on_finish && OS::get_singleton()->has_feature("movie")) {
|
||||
print_line(vformat("Movie Maker mode is enabled. Quitting on animation finish as requested by: %s", get_path()));
|
||||
get_tree()->quit();
|
||||
@@ -463,7 +463,7 @@ void AnimationPlayer::_play(const StringName &p_name, double p_custom_blend, flo
|
||||
_set_process(true); // Always process when starting an animation.
|
||||
playing = true;
|
||||
|
||||
emit_signal(SceneStringNames::get_singleton()->animation_started, c.assigned);
|
||||
emit_signal(SceneStringName(animation_started), c.assigned);
|
||||
|
||||
if (is_inside_tree() && Engine::get_singleton()->is_editor_hint()) {
|
||||
return; // No next in this case.
|
||||
|
||||
Reference in New Issue
Block a user