summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJakub Grzesik <kubecz3k@gmail.com>2017-07-04 12:50:20 +0200
committerJakub Grzesik <kubecz3k@gmail.com>2017-07-04 12:50:20 +0200
commit5f13b4251374646f3998b5b2583a3bcc08b3bdd4 (patch)
treee7d84f0d042a3ec4030816fd8acb92aaa1d88098 /editor
parenta2586a21196aaf6327a312915b777dec4d3859cc (diff)
fix for redundant RMB options for toplevel node
Diffstat (limited to 'editor')
-rw-r--r--editor/scene_tree_dock.cpp8
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);