When script changes, defer tree updating. Fixes #9704
This commit is contained in:
parent
6277e6d40a
commit
a5c3e3084a
2 changed files with 8 additions and 3 deletions
|
@ -354,7 +354,11 @@ void SceneTreeEditor::_update_visibility_color(Node *p_node, TreeItem *p_item) {
|
||||||
|
|
||||||
void SceneTreeEditor::_node_script_changed(Node *p_node) {
|
void SceneTreeEditor::_node_script_changed(Node *p_node) {
|
||||||
|
|
||||||
_update_tree();
|
if (tree_dirty)
|
||||||
|
return;
|
||||||
|
|
||||||
|
MessageQueue::get_singleton()->push_call(this, "_update_tree");
|
||||||
|
tree_dirty = true;
|
||||||
/*
|
/*
|
||||||
changes the order :|
|
changes the order :|
|
||||||
TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL;
|
TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL;
|
||||||
|
|
|
@ -1599,17 +1599,18 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so
|
||||||
Object *obj = E->get()->placeholders.front()->get()->get_owner();
|
Object *obj = E->get()->placeholders.front()->get()->get_owner();
|
||||||
|
|
||||||
//save instance info
|
//save instance info
|
||||||
List<Pair<StringName, Variant> > state;
|
|
||||||
if (obj->get_script_instance()) {
|
if (obj->get_script_instance()) {
|
||||||
|
|
||||||
|
map.insert(obj->get_instance_id(), List<Pair<StringName, Variant> >());
|
||||||
|
List<Pair<StringName, Variant> > &state = map[obj->get_instance_id()];
|
||||||
obj->get_script_instance()->get_property_state(state);
|
obj->get_script_instance()->get_property_state(state);
|
||||||
map[obj->get_instance_id()] = state;
|
|
||||||
obj->set_script(RefPtr());
|
obj->set_script(RefPtr());
|
||||||
} else {
|
} else {
|
||||||
// no instance found. Let's remove it so we don't loop forever
|
// no instance found. Let's remove it so we don't loop forever
|
||||||
E->get()->placeholders.erase(E->get()->placeholders.front()->get());
|
E->get()->placeholders.erase(E->get()->placeholders.front()->get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (Map<ObjectID, List<Pair<StringName, Variant> > >::Element *F = E->get()->pending_reload_state.front(); F; F = F->next()) {
|
for (Map<ObjectID, List<Pair<StringName, Variant> > >::Element *F = E->get()->pending_reload_state.front(); F; F = F->next()) {
|
||||||
|
|
Loading…
Reference in a new issue