diff options
-rw-r--r-- | doc/classes/GraphEdit.xml | 2 | ||||
-rw-r--r-- | editor/plugins/animation_tree_editor_plugin.cpp | 34 | ||||
-rw-r--r-- | scene/gui/label.cpp | 4 |
3 files changed, 14 insertions, 26 deletions
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index ce0b619d67..5ac3db1e8e 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -82,7 +82,7 @@ <return type="Array"> </return> <description> - Return an Array containing the list of connections. A connection consists in a structure of the form {from_slot: 0, from: "GraphNode name 0", to_slot: 1, to: "GraphNode name 1" } + Return an Array containing the list of connections. A connection consists in a structure of the form {from_port: 0, from: "GraphNode name 0", to_port: 1, to: "GraphNode name 1" } </description> </method> <method name="get_zoom_hbox"> diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index 24787a78e9..387a254c4f 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -64,34 +64,15 @@ void AnimationTreeEditor::edit(AnimationTree *p_tree) { void AnimationTreeEditor::_path_button_pressed(int p_path) { - Ref<AnimationNode> node = tree->get_tree_root(); - if (node.is_null()) - return; - edited_path.clear(); - if (p_path >= 0) { - for (int i = 0; i <= p_path; i++) { - Ref<AnimationNode> child = node->get_child_by_name(button_path[i]); - ERR_BREAK(child.is_null()); - node = child; - edited_path.push_back(button_path[i]); - } - } - - for (int i = 0; i < editors.size(); i++) { - if (editors[i]->can_edit(node)) { - editors[i]->edit(node); - editors[i]->show(); - } else { - editors[i]->edit(Ref<AnimationNode>()); - editors[i]->hide(); - } + for (int i = 0; i <= p_path; i++) { + edited_path.push_back(button_path[i]); } } void AnimationTreeEditor::_update_path() { - while (path_hb->get_child_count()) { - memdelete(path_hb->get_child(0)); + while (path_hb->get_child_count() > 1) { + memdelete(path_hb->get_child(1)); } Ref<ButtonGroup> group; @@ -176,6 +157,10 @@ void AnimationTreeEditor::_notification(int p_what) { if (root != current_root) { edit_path(Vector<String>()); } + + if (button_path.size() != edited_path.size()) { + edit_path(edited_path); + } } } @@ -251,6 +236,9 @@ AnimationTreeEditor::AnimationTreeEditor() { path_edit->set_enable_v_scroll(false); path_hb = memnew(HBoxContainer); path_edit->add_child(path_hb); + path_hb->add_child(memnew(Label(TTR("Path:")))); + + add_child(memnew(HSeparator)); current_root = 0; singleton = this; diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 1b7196c402..14e8c34d5f 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -244,7 +244,7 @@ void Label::_notification(int p_what) { CharType n = xl_text[i + pos + 1]; if (uppercase) { c = String::char_uppercase(c); - n = String::char_uppercase(c); + n = String::char_uppercase(n); } float move = font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + shadow_ofs, c, n, font_color_shadow, false); @@ -265,7 +265,7 @@ void Label::_notification(int p_what) { CharType n = xl_text[i + pos + 1]; if (uppercase) { c = String::char_uppercase(c); - n = String::char_uppercase(c); + n = String::char_uppercase(n); } x_ofs += drawer.draw_char(ci, Point2(x_ofs, y_ofs), c, n, font_color); |