diff options
| author | George Marques | 2016-06-12 13:43:31 -0300 |
|---|---|---|
| committer | George Marques | 2016-06-12 14:53:03 -0300 |
| commit | 68868aabc6f27a8facd8fe3ecb5719bc50f0f3f4 (patch) | |
| tree | 6f5d9ec78f4f3f20a22a532f26c67c88c2b10ef6 /tools/editor/create_dialog.cpp | |
| parent | a6c37d2b5d058d3bad2a942d965564c5054424c5 (diff) | |
| download | godot-68868aabc6f27a8facd8fe3ecb5719bc50f0f3f4.tar.gz godot-68868aabc6f27a8facd8fe3ecb5719bc50f0f3f4.tar.zst godot-68868aabc6f27a8facd8fe3ecb5719bc50f0f3f4.zip | |
Diffstat (limited to 'tools/editor/create_dialog.cpp')
| -rw-r--r-- | tools/editor/create_dialog.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index b6137ddac..5275e1bee 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -103,7 +103,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty item->set_selectable(0,false); } else { - if (!*to_select && (search_box->get_text()=="" || p_type.findn(search_box->get_text())!=-1)) { + if (!*to_select && (search_box->get_text().is_subsequence_ofi(p_type))) { *to_select=item; } @@ -172,7 +172,7 @@ void CreateDialog::_update_search() { bool found=false; String type=I->get(); while(type!="" && ObjectTypeDB::is_type(type,base_type) && type!=base_type) { - if (type.findn(search_box->get_text())!=-1) { + if (search_box->get_text().is_subsequence_ofi(type)) { found=true; break; @@ -194,7 +194,7 @@ void CreateDialog::_update_search() { const Vector<EditorData::CustomType> &ct = EditorNode::get_editor_data().get_custom_types()[type]; for(int i=0;i<ct.size();i++) { - bool show = search_box->get_text()=="" || ct[i].name.findn(search_box->get_text())!=-1; + bool show = search_box->get_text().is_subsequence_ofi(ct[i].name); if (!show) continue; |
