summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/tree.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 9c70785408..2c39aea08c 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2389,8 +2389,12 @@ void Tree::_input_event(InputEvent p_event) {
}
}
- if (!root)
+ if (!root || (!root->get_children() && hide_root)) {
+ if (b.button_index==BUTTON_RIGHT && allow_rmb_select) {
+ emit_signal("empty_tree_rmb_selected",get_local_mouse_pos());
+ }
break;
+ }
click_handled=false;
pressing_for_editor=false;
@@ -3551,9 +3555,10 @@ void Tree::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_single_select_cell_editing_only_when_already_selected"),&Tree::get_single_select_cell_editing_only_when_already_selected);
ADD_SIGNAL( MethodInfo("item_selected"));
- ADD_SIGNAL( MethodInfo("item_rmb_selected",PropertyInfo(Variant::VECTOR2,"pos")));
ADD_SIGNAL( MethodInfo("cell_selected"));
ADD_SIGNAL( MethodInfo("multi_selected",PropertyInfo(Variant::OBJECT,"item"),PropertyInfo(Variant::INT,"column"),PropertyInfo(Variant::BOOL,"selected")) );
+ ADD_SIGNAL( MethodInfo("item_rmb_selected",PropertyInfo(Variant::VECTOR2,"pos")));
+ ADD_SIGNAL( MethodInfo("empty_tree_rmb_selected",PropertyInfo(Variant::VECTOR2,"pos")));
ADD_SIGNAL( MethodInfo("item_edited"));
ADD_SIGNAL( MethodInfo("item_collapsed",PropertyInfo(Variant::OBJECT,"item")));
//ADD_SIGNAL( MethodInfo("item_doubleclicked" ) );