Keep editable instances data when replacing tree root node
(cherry picked from commit 3029f5ee02
)
This commit is contained in:
parent
52bf4a76b2
commit
dbcf969fbf
|
@ -1374,6 +1374,16 @@ bool Node::is_editable_instance(Node *p_node) const {
|
||||||
return data.editable_instances.has(p);
|
return data.editable_instances.has(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Node::set_editable_instances(const HashMap<NodePath,int>& p_editable_instances) {
|
||||||
|
|
||||||
|
data.editable_instances=p_editable_instances;
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<NodePath,int> Node::get_editable_instances() const {
|
||||||
|
|
||||||
|
return data.editable_instances;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
|
|
|
@ -239,6 +239,8 @@ public:
|
||||||
|
|
||||||
void set_editable_instance(Node* p_node,bool p_editable);
|
void set_editable_instance(Node* p_node,bool p_editable);
|
||||||
bool is_editable_instance(Node* p_node) const;
|
bool is_editable_instance(Node* p_node) const;
|
||||||
|
void set_editable_instances(const HashMap<NodePath,int>& p_editable_instances);
|
||||||
|
HashMap<NodePath,int> get_editable_instances() const;
|
||||||
|
|
||||||
|
|
||||||
/* NOTIFICATIONS */
|
/* NOTIFICATIONS */
|
||||||
|
|
|
@ -1318,6 +1318,7 @@ void SceneTreeDock::_create() {
|
||||||
if (n==edited_scene) {
|
if (n==edited_scene) {
|
||||||
edited_scene=newnode;
|
edited_scene=newnode;
|
||||||
editor->set_edited_scene(newnode);
|
editor->set_edited_scene(newnode);
|
||||||
|
newnode->set_editable_instances(n->get_editable_instances());
|
||||||
}
|
}
|
||||||
|
|
||||||
//small hack to make collisionshapes and other kind of nodes to work
|
//small hack to make collisionshapes and other kind of nodes to work
|
||||||
|
|
Loading…
Reference in New Issue