From 801db4c7086240b64b2f16d8bbd5b5e259ba2f1e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 30 Jun 2016 18:43:47 -0300 Subject: [PATCH] Make both signals be ordered and samplelibrary items too, fixes scenes changing for git, closes #5289 (cherry picked from commit b391306828294bc28675e135e7c2232ac6b8305a) --- scene/resources/packed_scene.cpp | 4 ++++ scene/resources/sample_library.cpp | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 64d80970d78..2017e0823f5 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -731,6 +731,7 @@ Error SceneState::_parse_connections(Node *p_owner,Node *p_node, Map _signals; p_node->get_signal_list(&_signals); + _signals.sort(); //ERR_FAIL_COND_V( !node_map.has(p_node), ERR_BUG); //NodeData &nd = nodes[node_map[p_node]]; @@ -740,6 +741,9 @@ Error SceneState::_parse_connections(Node *p_owner,Node *p_node, Map conns; p_node->get_signal_connection_list(E->get().name,&conns); + + conns.sort(); + for(List::Element *F=conns.front();F;F=F->next()) { const Node::Connection &c = F->get(); diff --git a/scene/resources/sample_library.cpp b/scene/resources/sample_library.cpp index 5b70ee0e119..73517b180e3 100644 --- a/scene/resources/sample_library.cpp +++ b/scene/resources/sample_library.cpp @@ -122,9 +122,17 @@ bool SampleLibrary::has_sample(const StringName& p_name) const { void SampleLibrary::_get_property_list(List *p_list) const { + + List tpl; for(Map::Element *E=sample_map.front();E;E=E->next()) { - p_list->push_back( PropertyInfo( Variant::DICTIONARY, "samples/"+E->key(),PROPERTY_HINT_RESOURCE_TYPE,"Sample",PROPERTY_USAGE_NOEDITOR ) ); + tpl.push_back( PropertyInfo( Variant::DICTIONARY, "samples/"+E->key(),PROPERTY_HINT_RESOURCE_TYPE,"Sample",PROPERTY_USAGE_NOEDITOR ) ); + } + + tpl.sort(); + //sort so order is kept + for(List::Element *E=tpl.front();E;E=E->next()) { + p_list->push_back(E->get()); } }