diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-12 10:46:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-12 10:46:21 +0200 |
commit | 42bc9ba92f6cd5018dfd90d76438b82b1606bd89 (patch) | |
tree | 668395c8c63abc16c41e64f33c33146f44663a62 | |
parent | ed4718285d91cb93ca7adf6af14e527686f14bce (diff) | |
parent | 22f0de8a838486ee38fe9de3d95768ee5ea4fd25 (diff) |
Merge pull request #39468 from KoBeWi/cpp_type_the_sequel
Fix custom types in node list search
-rw-r--r-- | editor/create_dialog.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index e4a853dbd7..4bd7371c21 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -347,20 +347,22 @@ void CreateDialog::_update_search() { } else { bool found = false; String type2 = type; + bool cpp_type2 = cpp_type; if (!cpp_type && !search_loaded_scripts.has(type)) { search_loaded_scripts[type] = ed.script_class_load_script(type); } - while (type2 != "" && (cpp_type ? ClassDB::is_parent_class(type2, base_type) : ed.script_class_is_parent(type2, base_type)) && type2 != base_type) { + while (type2 != "" && (cpp_type2 ? ClassDB::is_parent_class(type2, base_type) : ed.script_class_is_parent(type2, base_type)) && type2 != base_type) { if (search_box->get_text().is_subsequence_ofi(type2)) { found = true; break; } - type2 = cpp_type ? ClassDB::get_parent_class(type2) : ed.script_class_get_base(type2); + type2 = cpp_type2 ? ClassDB::get_parent_class(type2) : ed.script_class_get_base(type2); + cpp_type2 = cpp_type2 || ClassDB::class_exists(type2); // Built-in class can't inherit from custom type, so we can skip the check if it's already true. - if (!cpp_type && !search_loaded_scripts.has(type2)) { + if (!cpp_type2 && !search_loaded_scripts.has(type2)) { search_loaded_scripts[type2] = ed.script_class_load_script(type2); } } |