summaryrefslogtreecommitdiffstats
path: root/editor/plugins/animation_state_machine_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/animation_state_machine_editor.cpp')
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index 8efd12ecf9..ee30294fe7 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -1064,6 +1064,7 @@ void AnimationNodeStateMachineEditor::_open_editor(const String &p_name) {
}
void AnimationNodeStateMachineEditor::_removed_from_graph() {
+
EditorNode::get_singleton()->edit_item(NULL);
}
@@ -1099,7 +1100,13 @@ void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) {
name_edit->hide();
}
+void AnimationNodeStateMachineEditor::_name_edited_focus_out() {
+
+ _name_edited(name_edit->get_text());
+}
+
void AnimationNodeStateMachineEditor::_scroll_changed(double) {
+
if (updating)
return;
@@ -1217,6 +1224,7 @@ void AnimationNodeStateMachineEditor::_bind_methods() {
ClassDB::bind_method("_add_animation_type", &AnimationNodeStateMachineEditor::_add_animation_type);
ClassDB::bind_method("_name_edited", &AnimationNodeStateMachineEditor::_name_edited);
+ ClassDB::bind_method("_name_edited_focus_out", &AnimationNodeStateMachineEditor::_name_edited_focus_out);
ClassDB::bind_method("_removed_from_graph", &AnimationNodeStateMachineEditor::_removed_from_graph);
@@ -1356,6 +1364,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
state_machine_draw->add_child(name_edit);
name_edit->hide();
name_edit->connect("text_entered", this, "_name_edited");
+ name_edit->connect("focus_exited", this, "_name_edited_focus_out");
name_edit->set_as_toplevel(true);
open_file = memnew(EditorFileDialog);