aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/scene_tree_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/scene_tree_editor.cpp')
-rw-r--r--tools/editor/scene_tree_editor.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index 89b7e5419..e2ae897fe 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -73,6 +73,12 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id)
undo_redo->commit_action();
} else if (n->is_type("CanvasItem")) {
+ CanvasItem *ci = n->cast_to<CanvasItem>();
+ if (!ci->is_visible() && ci->get_parent_item() && !ci->get_parent_item()->is_visible()) {
+ error->set_text("This item cannot be made visible because the parent is hidden. Unhide the parent first.");
+ error->popup_centered_minsize(Size2(400,80));
+ return;
+ }
bool v = !bool(n->call("is_hidden"));
undo_redo->create_action("Toggle CanvasItem Visible");
undo_redo->add_do_method(n,v?"hide":"show");
@@ -663,6 +669,9 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open
tree->connect("button_pressed",this,"_cell_button_pressed");
// tree->connect("item_edited", this,"_renamed",Vector<Variant>(),true);
+ error = memnew( AcceptDialog );
+ add_child(error);
+
last_hash=0;
pending_test_update=false;
updating_tree=false;