1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Small fixes for the AnimationTree editor

This commit is contained in:
Michael Alexsander Silva Dias
2018-12-18 15:23:39 -02:00
parent 89abfd40ed
commit 2b278a5336
3 changed files with 11 additions and 1 deletions

View File

@@ -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);