diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-07-05 10:51:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-05 10:51:31 +0200 |
commit | c81fd8c6874e7e08cf801da11188b92fdc00e345 (patch) | |
tree | da8c89c2e482633ec70d3f9a23ad5d94be466ff8 | |
parent | f4ff452a58b46b4ed8429eeeb32bfe766acc829a (diff) | |
parent | 5f13b4251374646f3998b5b2583a3bcc08b3bdd4 (diff) |
Merge pull request #9492 from kubecz3k/subscene-click-fix
fix for redundant RMB options for toplevel node
-rw-r--r-- | editor/scene_tree_dock.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index e8fa3f78cc..886474200e 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1876,14 +1876,16 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->add_icon_shortcut(get_icon("CreateNewSceneFrom", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/save_branch_as_scene"), TOOL_NEW_SCENE_FROM); menu->add_separator(); menu->add_icon_shortcut(get_icon("CopyNodePath", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/copy_node_path"), TOOL_COPY_NODE_PATH); - bool is_external = (selection[0]->get_filename() != "") && (selection[0]->get_owner() != selection[0]); + bool is_external = (selection[0]->get_filename() != ""); if (is_external) { bool is_inherited = selection[0]->get_scene_inherited_state() != NULL; - menu->add_separator(); + bool is_top_level = selection[0]->get_owner() == NULL; if (is_inherited) { + menu->add_separator(); menu->add_item(TTR("Clear Inheritance"), TOOL_SCENE_CLEAR_INHERITANCE); menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Open in Editor"), TOOL_SCENE_OPEN_INHERITED); - } else { + } else if (!is_top_level) { + menu->add_separator(); bool editable = EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(selection[0]); bool placeholder = selection[0]->get_scene_instance_load_placeholder(); menu->add_check_item(TTR("Editable Children"), TOOL_SCENE_EDITABLE_CHILDREN); |