diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-11-15 10:42:38 -0600 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-11-15 10:42:38 -0600 |
commit | 46d83fd149360c5af21688fafc68ba689ca2c3eb (patch) | |
tree | b954cd0b465bd33f63a0c9ddc5711af2f5974ebd /scene | |
parent | f5431fe3f0f6373a5c19dd922b64eb419c484369 (diff) | |
parent | a389eb4608d87ea071916b52b40bd28aa542e9ae (diff) | |
download | redot-engine-46d83fd149360c5af21688fafc68ba689ca2c3eb.tar.gz |
Merge pull request #99277 from HolonProduction/why-remove-this-in-the-first-place
Add back `AnimationPlayer.get_argument_options`
Diffstat (limited to 'scene')
-rw-r--r-- | scene/animation/animation_player.cpp | 14 | ||||
-rw-r--r-- | scene/animation/animation_player.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index b3a75a75a0..7d28aead6e 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -876,6 +876,20 @@ Tween::EaseType AnimationPlayer::get_auto_capture_ease_type() const { return auto_capture_ease_type; } +#ifdef TOOLS_ENABLED +void AnimationPlayer::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const { + const String pf = p_function; + if (p_idx == 0 && (pf == "play" || pf == "play_backwards" || pf == "has_animation" || pf == "queue")) { + List<StringName> al; + get_animation_list(&al); + for (const StringName &name : al) { + r_options->push_back(String(name).quote()); + } + } + AnimationMixer::get_argument_options(p_function, p_idx, r_options); +} +#endif + void AnimationPlayer::_animation_removed(const StringName &p_name, const StringName &p_library) { AnimationMixer::_animation_removed(p_name, p_library); diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 06b3eecb89..6d7e8aa996 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -178,6 +178,10 @@ public: void set_auto_capture_ease_type(Tween::EaseType p_auto_capture_ease_type); Tween::EaseType get_auto_capture_ease_type() const; +#ifdef TOOLS_ENABLED + void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override; +#endif + void play(const StringName &p_name = StringName(), double p_custom_blend = -1, float p_custom_scale = 1.0, bool p_from_end = false); void play_section_with_markers(const StringName &p_name = StringName(), const StringName &p_start_marker = StringName(), const StringName &p_end_marker = StringName(), double p_custom_blend = -1, float p_custom_scale = 1.0, bool p_from_end = false); void play_section(const StringName &p_name = StringName(), double p_start_time = -1, double p_end_time = -1, double p_custom_blend = -1, float p_custom_scale = 1.0, bool p_from_end = false); |