summaryrefslogtreecommitdiff
path: root/editor/scene_tree_editor.cpp
diff options
context:
space:
mode:
authorJakub Grzesik <kubecz3k@gmail.com>2017-10-23 21:21:15 +0200
committerJakub Grzesik <kubecz3k@gmail.com>2017-11-11 12:56:37 +0100
commit518d90791495359a26836c90c1d1ac101669e4ee (patch)
treeda65d3b11bff2b6121128f47bcad3cedfea31931 /editor/scene_tree_editor.cpp
parent35e7f992993a69a1e25cc12109ef7cf885e18260 (diff)
ability to lock spatial nodes transform in editor
Diffstat (limited to 'editor/scene_tree_editor.cpp')
-rw-r--r--editor/scene_tree_editor.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index a6e0af05b2..1bd0858fe8 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -88,7 +88,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
} else if (p_id == BUTTON_LOCK) {
- if (n->is_class("CanvasItem")) {
+ if (n->is_class("CanvasItem") || n->is_class("Spatial")) {
n->set_meta("_edit_lock_", Variant());
_update_tree();
emit_signal("node_changed");
@@ -266,6 +266,10 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
_update_visibility_color(p_node, item);
} else if (p_node->is_class("Spatial")) {
+ bool is_locked = p_node->has_meta("_edit_lock_");
+ if (is_locked)
+ item->add_button(0, get_icon("Lock", "EditorIcons"), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock"));
+
bool v = p_node->call("is_visible");
if (v)
item->add_button(0, get_icon("Visible", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));