summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorjmb462 <jmb462@gmail.com>2021-11-05 21:51:42 +0100
committerJean-Michel Bernard <jmb462@gmail.com>2022-08-26 00:05:58 +0200
commitae9560af827fee8d232e997566775cbeb5a3287a (patch)
tree7da9ecef374311ece83410d10a3ef7f2a6a63542 /scene/3d
parenta8476c04f457a3fd3eecf32cc8fbd86381ac0826 (diff)
Fix AnimatedSprite2D & 3D animation list in inspector
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/sprite_3d.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 212d220ace..669c3eb7fd 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -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;
}
}