diff options
Diffstat (limited to 'editor/scene_tree_editor.cpp')
-rw-r--r-- | editor/scene_tree_editor.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 6fe52e3337..7d2127d4f8 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.")); + } } } |