Merge pull request #54646 from jmb462/fix-animatedsprite-animation-list

Fix AnimatedSprite2D & 3D animation list in inspector
This commit is contained in:
Rémi Verschelde 2022-08-26 08:22:51 +02:00 committed by GitHub
commit af692912d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -115,14 +115,17 @@ void AnimatedSprite2D::_validate_property(PropertyInfo &p_property) const {
names.sort_custom<StringName::AlphCompare>();
bool current_found = false;
bool is_first_element = true;
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
if (E->prev()) {
for (const StringName &E : names) {
if (!is_first_element) {
p_property.hint_string += ",";
} else {
is_first_element = false;
}
p_property.hint_string += String(E->get());
if (animation == E->get()) {
p_property.hint_string += String(E);
if (animation == E) {
current_found = true;
}
}

View File

@ -1004,14 +1004,17 @@ void AnimatedSprite3D::_validate_property(PropertyInfo &p_property) const {
names.sort_custom<StringName::AlphCompare>();
bool current_found = false;
bool is_first_element = true;
for (List<StringName>::Element *E = names.front(); E; E = E->next()) {
if (E->prev()) {
for (const StringName &E : names) {
if (!is_first_element) {
p_property.hint_string += ",";
} else {
is_first_element = false;
}
p_property.hint_string += String(E->get());
if (animation == E->get()) {
p_property.hint_string += String(E);
if (animation == E) {
current_found = true;
}
}