diff options
-rw-r--r-- | editor/editor_quick_open.h | 2 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 17 | ||||
-rw-r--r-- | scene/gui/item_list.cpp | 16 |
3 files changed, 12 insertions, 23 deletions
diff --git a/editor/editor_quick_open.h b/editor/editor_quick_open.h index 86a419b538..83cbbd7cac 100644 --- a/editor/editor_quick_open.h +++ b/editor/editor_quick_open.h @@ -43,7 +43,7 @@ class EditorQuickOpen : public ConfirmationDialog { Tree *search_options = nullptr; StringName base_type; bool allow_multi_select = false; - bool _load_resources = true; + bool _load_resources = false; // Prohibitively slow for now. Vector<String> files; OAHashMap<String, Ref<Texture2D>> icons; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 1ae4c530e8..ad07ac180b 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1487,16 +1487,17 @@ bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_ } static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) { - if (p_edited_scene != p_current_node && p_current_node->get_owner() != p_edited_scene) { - return nullptr; - } - - Ref<Script> scr = p_current_node->get_script(); - - if (scr.is_valid() && scr == script) { - return p_current_node; + // Check scripts only for the nodes belonging to the edited scene. + if (p_current_node == p_edited_scene || p_current_node->get_owner() == p_edited_scene) { + Ref<Script> scr = p_current_node->get_script(); + if (scr.is_valid() && scr == script) { + return p_current_node; + } } + // Traverse all children, even the ones not owned by the edited scene as they + // can still have child nodes added within the edited scene and thus owned by + // it (e.g. nodes added to subscene's root or to its editable children). for (int i = 0; i < p_current_node->get_child_count(); i++) { Node *n = _find_script_node(p_edited_scene, p_current_node->get_child(i), script); if (n) { diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 008109da65..357f2480bd 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -662,19 +662,7 @@ void ItemList::gui_input(const Ref<InputEvent> &p_event) { pos.x = get_size().width - pos.x; } - int closest = -1; - - for (int i = 0; i < items.size(); i++) { - Rect2 rc = items[i].rect_cache; - if (i % current_columns == current_columns - 1) { - rc.size.width = get_size().width; //not right but works - } - - if (rc.has_point(pos)) { - closest = i; - break; - } - } + int closest = get_item_at_position(mb->get_position(), true); if (closest != -1 && (mb->get_button_index() == MouseButton::LEFT || (allow_rmb_select && mb->get_button_index() == MouseButton::RIGHT))) { int i = closest; @@ -1467,7 +1455,7 @@ int ItemList::get_item_at_position(const Point2 &p_pos, bool p_exact) const { for (int i = 0; i < items.size(); i++) { Rect2 rc = items[i].rect_cache; if (i % current_columns == current_columns - 1) { - rc.size.width = get_size().width - rc.position.x; //make sure you can still select the last item when clicking past the column + rc.size.width = get_size().width - rc.position.x; // Make sure you can still select the last item when clicking past the column. } if (rc.has_point(pos)) { |