summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-05-20 11:42:06 +0200
committerGitHub <noreply@github.com>2020-05-20 11:42:06 +0200
commita325a777a647738c222bb70aa1467e4e6516224c (patch)
treeebb99c2d3c4f38d63d51a7c043d7024fe0c0589b /editor
parentcba1f492cc300bf5686f8ccd7f743bc37635fa54 (diff)
parentd015e4d6fcc85ba892a7fa2a511f1f5d72880d0d (diff)
Merge pull request #38834 from YeldhamDev/change_type_keep_meta
Keep "lock" metadata when changing a Node's type, if applicable
Diffstat (limited to 'editor')
-rw-r--r--editor/scene_tree_dock.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 514bb8dd03..a81a2ff4e9 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -2064,9 +2064,21 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
continue;
}
+
if (E->get().name == "__meta__") {
+ if (Object::cast_to<CanvasItem>(newnode)) {
+ Dictionary metadata = n->get(E->get().name);
+ if (metadata.has("_edit_group_") && metadata["_edit_group_"]) {
+ newnode->set_meta("_edit_group_", true);
+ }
+ if (metadata.has("_edit_lock_") && metadata["_edit_lock_"]) {
+ newnode->set_meta("_edit_lock_", true);
+ }
+ }
+
continue;
}
+
if (default_oldnode->get(E->get().name) != n->get(E->get().name)) {
newnode->set(E->get().name, n->get(E->get().name));
}