diff options
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r-- | scene/main/node.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index de486094fe..52c1df8110 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1987,7 +1987,16 @@ String Node::get_scene_file_path() const { } void Node::set_editor_description(const String &p_editor_description) { + if (data.editor_description == p_editor_description) { + return; + } + data.editor_description = p_editor_description; + + if (Engine::get_singleton()->is_editor_hint() && is_inside_tree()) { + // Update tree so the tooltip in the Scene tree dock is also updated in the editor. + get_tree()->tree_changed(); + } } String Node::get_editor_description() const { @@ -2126,13 +2135,13 @@ Node *Node::_duplicate(int p_flags, HashMap<const Node *, Node *> *r_duplimap) c } else if ((p_flags & DUPLICATE_USE_INSTANTIATION) && !get_scene_file_path().is_empty()) { Ref<PackedScene> res = ResourceLoader::load(get_scene_file_path()); ERR_FAIL_COND_V(res.is_null(), nullptr); - PackedScene::GenEditState ges = PackedScene::GEN_EDIT_STATE_DISABLED; + PackedScene::GenEditState edit_state = PackedScene::GEN_EDIT_STATE_DISABLED; #ifdef TOOLS_ENABLED if (p_flags & DUPLICATE_FROM_EDITOR) { - ges = PackedScene::GEN_EDIT_STATE_INSTANCE; + edit_state = PackedScene::GEN_EDIT_STATE_INSTANCE; } #endif - node = res->instantiate(ges); + node = res->instantiate(edit_state); ERR_FAIL_COND_V(!node, nullptr); node->set_scene_instance_load_placeholder(get_scene_instance_load_placeholder()); |