store animation names in alphabetical order, fixes #3423

This commit is contained in:
Juan Linietsky 2016-02-01 00:19:45 -03:00
parent 0cd8c054a2
commit 11933811ee

View File

@ -147,14 +147,21 @@ void AnimationPlayer::_get_property_list( List<PropertyInfo> *p_list) const {
List<String> names; List<String> names;
List<PropertyInfo> anim_names;
for( Map<StringName, AnimationData>::Element *E=animation_set.front();E;E=E->next()) { for( Map<StringName, AnimationData>::Element *E=animation_set.front();E;E=E->next()) {
p_list->push_back( PropertyInfo( Variant::OBJECT, "anims/"+String(E->key()), PROPERTY_HINT_RESOURCE_TYPE, "Animation",PROPERTY_USAGE_NOEDITOR) ); anim_names.push_back( PropertyInfo( Variant::OBJECT, "anims/"+String(E->key()), PROPERTY_HINT_RESOURCE_TYPE, "Animation",PROPERTY_USAGE_NOEDITOR) );
if (E->get().next!=StringName()) if (E->get().next!=StringName())
p_list->push_back( PropertyInfo( Variant::STRING, "next/"+String(E->key()), PROPERTY_HINT_NONE, "",PROPERTY_USAGE_NOEDITOR) ); anim_names.push_back( PropertyInfo( Variant::STRING, "next/"+String(E->key()), PROPERTY_HINT_NONE, "",PROPERTY_USAGE_NOEDITOR) );
names.push_back(E->key()); names.push_back(E->key());
} }
anim_names.sort();
for( List<PropertyInfo>::Element *E=anim_names.front();E;E=E->next()) {
p_list->push_back(E->get());
}
{ {
names.sort(); names.sort();