From b86b497cec8f0b3fa348f8c9b7bcce7d20232292 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Mon, 17 Dec 2018 21:03:25 -0200 Subject: [PATCH] General fixes for the AnimationTree editor --- doc/classes/GraphNode.xml | 2 ++ editor/filesystem_dock.cpp | 2 +- editor/plugins/animation_blend_space_1d_editor.cpp | 2 +- editor/plugins/animation_blend_tree_editor_plugin.cpp | 4 +++- editor/plugins/animation_state_machine_editor.cpp | 4 +++- editor/scene_tree_editor.cpp | 2 +- scene/resources/default_theme/default_theme.cpp | 1 + 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index 4c39720d694..6e09926c119 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -236,6 +236,8 @@ + + diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index b2368fff6bc..4cc0b67b8d1 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1180,7 +1180,7 @@ void FileSystemDock::_make_dir_confirm() { String dir_name = make_dir_dialog_text->get_text().strip_edges(); if (dir_name.length() == 0) { - EditorNode::get_singleton()->show_warning(TTR("No name provided")); + EditorNode::get_singleton()->show_warning(TTR("No name provided.")); return; } else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.find("*") != -1 || dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) { diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index 586b7668adb..cb188326415 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -72,7 +72,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Refget_animation_list(&names); for (List::Element *E = names.front(); E; E = E->next()) { - animations_menu->add_icon_item(get_icon("Animation", "Editoricons"), E->get()); + animations_menu->add_icon_item(get_icon("Animation", "EditorIcons"), E->get()); animations_to_add.push_back(E->get()); } } diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 81d048b2b4c..06c2db74afd 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -395,7 +395,7 @@ void AnimationNodeBlendTreeEditor::_delete_request(const String &p_which) { undo_redo->create_action("Delete Node"); undo_redo->add_do_method(blend_tree.ptr(), "remove_node", p_which); - undo_redo->add_undo_method(blend_tree.ptr(), "add_node", p_which, blend_tree->get_node(p_which)); + undo_redo->add_undo_method(blend_tree.ptr(), "add_node", p_which, blend_tree->get_node(p_which), blend_tree.ptr()->get_node_position(p_which)); List conns; blend_tree->get_node_connections(&conns); @@ -813,6 +813,8 @@ void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref p_node) { diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index df7ac0b5871..8efd12ecf92 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1073,7 +1073,9 @@ void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) { ERR_FAIL_COND(new_name == "" || new_name.find(".") != -1 || new_name.find("/") != -1) - ERR_FAIL_COND(new_name == prev_name); + if (new_name == prev_name) { + return; // Nothing to do. + } String base_name = new_name; int base = 1; diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 7205f343430..657293ea7fb 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -668,7 +668,7 @@ void SceneTreeEditor::_renamed() { // Empty node names are not allowed, so resets it to previous text and show warning if (which->get_text(0).strip_edges().empty()) { which->set_text(0, n->get_name()); - EditorNode::get_singleton()->show_warning(TTR("No name provided")); + EditorNode::get_singleton()->show_warning(TTR("No name provided.")); return; } diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index b0c1dcde9a7..7d7bf8a7509 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -600,6 +600,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_icon("resizer", "GraphNode", make_icon(window_resizer_png)); theme->set_font("title_font", "GraphNode", default_font); theme->set_color("title_color", "GraphNode", Color(0, 0, 0, 1)); + theme->set_color("close_color", "GraphNode", Color(0, 0, 0, 1)); theme->set_constant("title_offset", "GraphNode", 20 * scale); theme->set_constant("close_offset", "GraphNode", 18 * scale); theme->set_constant("port_offset", "GraphNode", 3 * scale);