Add autocompletion options for AnimatedSprite's other play methods
(cherry picked from commit d5a7c7818c
)
This commit is contained in:
parent
c35e05e7b1
commit
873a77d8e9
|
@ -561,11 +561,13 @@ PackedStringArray AnimatedSprite2D::get_configuration_warnings() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimatedSprite2D::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
|
void AnimatedSprite2D::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
|
||||||
if (p_idx == 0 && p_function == "play" && frames.is_valid()) {
|
if (p_idx == 0 && frames.is_valid()) {
|
||||||
List<StringName> al;
|
if (p_function == "play" || p_function == "play_backwards" || p_function == "set_animation" || p_function == "set_autoplay") {
|
||||||
frames->get_animation_list(&al);
|
List<StringName> al;
|
||||||
for (const StringName &name : al) {
|
frames->get_animation_list(&al);
|
||||||
r_options->push_back(String(name).quote());
|
for (const StringName &name : al) {
|
||||||
|
r_options->push_back(String(name).quote());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Node::get_argument_options(p_function, p_idx, r_options);
|
Node::get_argument_options(p_function, p_idx, r_options);
|
||||||
|
|
|
@ -1365,11 +1365,13 @@ PackedStringArray AnimatedSprite3D::get_configuration_warnings() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimatedSprite3D::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
|
void AnimatedSprite3D::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
|
||||||
if (p_idx == 0 && p_function == "play" && frames.is_valid()) {
|
if (p_idx == 0 && frames.is_valid()) {
|
||||||
List<StringName> al;
|
if (p_function == "play" || p_function == "play_backwards" || p_function == "set_animation" || p_function == "set_autoplay") {
|
||||||
frames->get_animation_list(&al);
|
List<StringName> al;
|
||||||
for (const StringName &name : al) {
|
frames->get_animation_list(&al);
|
||||||
r_options->push_back(String(name).quote());
|
for (const StringName &name : al) {
|
||||||
|
r_options->push_back(String(name).quote());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Node::get_argument_options(p_function, p_idx, r_options);
|
Node::get_argument_options(p_function, p_idx, r_options);
|
||||||
|
|
Loading…
Reference in New Issue