aboutsummaryrefslogtreecommitdiff
path: root/editor/scene_tree_editor.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2018-06-07 12:46:14 -0300
committerJuan Linietsky2018-06-07 12:52:00 -0300
commitb659fd6d7442701284cbb8763fb712be36d17ed0 (patch)
tree4c5bcc78fb9ae1c77e91854b5ee90acbdaadeba9 /editor/scene_tree_editor.cpp
parent3cd09cd9437ba7ad1755734beae3fd2c1e594566 (diff)
downloadgodot-b659fd6d7442701284cbb8763fb712be36d17ed0.tar.gz
godot-b659fd6d7442701284cbb8763fb712be36d17ed0.tar.zst
godot-b659fd6d7442701284cbb8763fb712be36d17ed0.zip
Diffstat (limited to 'editor/scene_tree_editor.cpp')
-rw-r--r--editor/scene_tree_editor.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 6fe52e333..7d2127d4f 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -30,6 +30,7 @@
#include "scene_tree_editor.h"
+#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/canvas_item_editor_plugin.h"
#include "editor_node.h"
#include "message_queue.h"
@@ -90,6 +91,12 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
_update_tree();
emit_signal("node_changed");
}
+ } else if (p_id == BUTTON_PIN) {
+
+ if (n->is_class("AnimationPlayer")) {
+ AnimationPlayerEditor::singleton->unpin();
+ _update_tree();
+ }
} else if (p_id == BUTTON_GROUP) {
if (n->is_class("CanvasItem")) {
@@ -284,6 +291,13 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
p_node->connect("visibility_changed", this, "_node_visibility_changed", varray(p_node));
_update_visibility_color(p_node, item);
+ } else if (p_node->is_class("AnimationPlayer")) {
+
+ bool is_pinned = AnimationPlayerEditor::singleton->get_player() == p_node && AnimationPlayerEditor::singleton->is_pinned();
+
+ if (is_pinned) {
+ item->add_button(0, get_icon("Pin", "EditorIcons"), BUTTON_PIN, false, TTR("AnimationPlayer is pinned.\nClick to unpin."));
+ }
}
}