diff options
| author | Juan Linietsky | 2014-03-13 22:57:24 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-03-13 22:57:24 -0300 |
| commit | 31ce3c5fd0300aac1e86bced1efc5f9ec94bdb6b (patch) | |
| tree | b6d3a290333c72940b49ed4c930ff6858a59515e /tools/editor/scene_tree_editor.cpp | |
| parent | a65edb4caabec21654c56552e11aacf0fd9291de (diff) | |
| download | godot-31ce3c5fd0300aac1e86bced1efc5f9ec94bdb6b.tar.gz godot-31ce3c5fd0300aac1e86bced1efc5f9ec94bdb6b.tar.zst godot-31ce3c5fd0300aac1e86bced1efc5f9ec94bdb6b.zip | |
Diffstat (limited to 'tools/editor/scene_tree_editor.cpp')
| -rw-r--r-- | tools/editor/scene_tree_editor.cpp | 9 |
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; |
