diff options
Diffstat (limited to 'editor/scene_tree_dock.cpp')
-rw-r--r-- | editor/scene_tree_dock.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index eaefd04c6b..92f899a35d 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -30,7 +30,7 @@ #include "scene_tree_dock.h" -#include "core/input/input_filter.h" +#include "core/input/input.h" #include "core/io/resource_saver.h" #include "core/os/keyboard.h" #include "core/project_settings.h" @@ -1030,7 +1030,7 @@ void SceneTreeDock::_node_collapsed(Object *p_obj) { if (!ti) return; - if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) { + if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { _set_collapsed_recursive(ti, ti->is_collapsed()); } } @@ -1535,7 +1535,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V if (p_nodes[ni] == p_new_parent) return; // Attempt to reparent to itself. - if (p_nodes[ni]->get_parent() != p_new_parent || p_position_in_parent + ni != p_nodes[ni]->get_position_in_parent()) + if (p_nodes[ni]->get_parent() != p_new_parent || p_position_in_parent + ni != p_nodes[ni]->get_index()) no_change = false; } @@ -1644,7 +1644,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V owners.push_back(E->get()); } - int child_pos = node->get_position_in_parent(); + int child_pos = node->get_index(); editor_data->get_undo_redo().add_undo_method(node->get_parent(), "add_child", node); editor_data->get_undo_redo().add_undo_method(node->get_parent(), "move_child", node, child_pos); @@ -1918,7 +1918,7 @@ Node *SceneTreeDock::_get_selection_group_tail(Node *p_node, List<Node *> p_list Node *tail = p_node; Node *parent = tail->get_parent(); - for (int i = p_node->get_position_in_parent(); i < parent->get_child_count(); i++) { + for (int i = p_node->get_index(); i < parent->get_child_count(); i++) { Node *sibling = parent->get_child(i); if (p_list.find(sibling)) @@ -2346,7 +2346,7 @@ void SceneTreeDock::_nodes_dragged(Array p_nodes, NodePath p_to, int p_type) { int to_pos = -1; _normalize_drop(to_node, to_pos, p_type); - _do_reparent(to_node, to_pos, nodes, !InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)); + _do_reparent(to_node, to_pos, nodes, !Input::get_singleton()->is_key_pressed(KEY_SHIFT)); } void SceneTreeDock::_add_children_to_popup(Object *p_obj, int p_depth) { @@ -2867,6 +2867,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel edit_local->set_h_size_flags(SIZE_EXPAND_FILL); edit_local->set_text(TTR("Local")); edit_local->set_toggle_mode(true); + edit_local->set_pressed(true); edit_local->connect("pressed", callable_mp(this, &SceneTreeDock::_local_tree_selected)); remote_tree = nullptr; |