diff options
author | DualMatrix <piet.goris@gmail.com> | 2018-09-08 16:36:17 +0200 |
---|---|---|
committer | DualMatrix <piet.goris@gmail.com> | 2018-09-10 20:58:29 +0200 |
commit | 6ec28de584e23b162ecb65a2451a9ae109fa0ebf (patch) | |
tree | 841e94800c8ffdb0e10abdb3e16bb50acb99f1ed | |
parent | 4b6846a59d785af3bef6a29958387ed0ee0f6575 (diff) |
Fixed favorites and recent nodes selecting wrong node
Fixed favorites and recent nodes selecting wrong node and fixed a typo.
Fixes #6535
-rw-r--r-- | editor/create_dialog.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index fd607e5b63..1853bf517b 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -244,17 +244,17 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p bool is_search_subsequence = search_box->get_text().is_subsequence_ofi(p_type); String to_select_type = *to_select ? (*to_select)->get_text(0) : ""; to_select_type = to_select_type.split(" ")[0]; - bool current_item_is_preffered; + bool current_item_is_preferred; if (cpp_type) { - current_item_is_preffered = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(to_select_type, preferred_search_result_type); + current_item_is_preferred = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(to_select_type, preferred_search_result_type) && search_box->get_text() != to_select_type; } else { - current_item_is_preffered = ed.script_class_is_parent(p_type, preferred_search_result_type) && !ed.script_class_is_parent(to_select_type, preferred_search_result_type); + current_item_is_preferred = ed.script_class_is_parent(p_type, preferred_search_result_type) && !ed.script_class_is_parent(to_select_type, preferred_search_result_type) && search_box->get_text() != to_select_type; } if (*to_select && p_type.length() < (*to_select)->get_text(0).length()) { - current_item_is_preffered = true; + current_item_is_preferred = true; } - if (((!*to_select || current_item_is_preffered) && is_search_subsequence) || search_box->get_text() == p_type) { + if (((!*to_select || current_item_is_preferred) && is_search_subsequence) || search_box->get_text() == p_type) { *to_select = item; } } |