Make both signals be ordered and samplelibrary items too, fixes scenes changing for git, closes #5289

(cherry picked from commit b391306828)
This commit is contained in:
Juan Linietsky 2016-06-30 18:43:47 -03:00 committed by Rémi Verschelde
parent 9b90d70ae7
commit 801db4c708
2 changed files with 13 additions and 1 deletions

View File

@ -731,6 +731,7 @@ Error SceneState::_parse_connections(Node *p_owner,Node *p_node, Map<StringName,
List<MethodInfo> _signals; List<MethodInfo> _signals;
p_node->get_signal_list(&_signals); p_node->get_signal_list(&_signals);
_signals.sort();
//ERR_FAIL_COND_V( !node_map.has(p_node), ERR_BUG); //ERR_FAIL_COND_V( !node_map.has(p_node), ERR_BUG);
//NodeData &nd = nodes[node_map[p_node]]; //NodeData &nd = nodes[node_map[p_node]];
@ -740,6 +741,9 @@ Error SceneState::_parse_connections(Node *p_owner,Node *p_node, Map<StringName,
List<Node::Connection> conns; List<Node::Connection> conns;
p_node->get_signal_connection_list(E->get().name,&conns); p_node->get_signal_connection_list(E->get().name,&conns);
conns.sort();
for(List<Node::Connection>::Element *F=conns.front();F;F=F->next()) { for(List<Node::Connection>::Element *F=conns.front();F;F=F->next()) {
const Node::Connection &c = F->get(); const Node::Connection &c = F->get();

View File

@ -122,9 +122,17 @@ bool SampleLibrary::has_sample(const StringName& p_name) const {
void SampleLibrary::_get_property_list(List<PropertyInfo> *p_list) const { void SampleLibrary::_get_property_list(List<PropertyInfo> *p_list) const {
List<PropertyInfo> tpl;
for(Map<StringName,SampleData>::Element *E=sample_map.front();E;E=E->next()) { for(Map<StringName,SampleData>::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<PropertyInfo>::Element *E=tpl.front();E;E=E->next()) {
p_list->push_back(E->get());
} }
} }