Fix AnimatedSprite2D & 3D animation list in inspector

This commit is contained in:
jmb462 2021-11-05 21:51:42 +01:00
parent 70c82d9d3d
commit 07349080a5
2 changed files with 14 additions and 6 deletions

View file

@ -115,13 +115,17 @@ void AnimatedSprite2D::_validate_property(PropertyInfo &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) {
property.hint_string += ",";
} else {
is_first_element = false;
}
property.hint_string += String(E->get());
property.hint_string += E;
if (animation == E) {
current_found = true;
}

View file

@ -989,13 +989,17 @@ void AnimatedSprite3D::_validate_property(PropertyInfo &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) {
property.hint_string += ",";
} else {
is_first_element = false;
}
property.hint_string += String(E->get());
property.hint_string += E;
if (animation == E) {
current_found = true;
}