diff options
Diffstat (limited to 'editor/editor_sectioned_inspector.cpp')
-rw-r--r-- | editor/editor_sectioned_inspector.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index a44cf20771..627fa0eb35 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -33,6 +33,20 @@ #include "editor/editor_property_name_processor.h" #include "editor/editor_scale.h" +static bool _property_path_matches(const String &p_property_path, const String &p_filter) { + if (p_property_path.findn(p_filter) != -1) { + return true; + } + + const Vector<String> sections = p_property_path.split("/"); + for (int i = 0; i < sections.size(); i++) { + if (p_filter.is_subsequence_ofn(EditorPropertyNameProcessor::get_singleton()->process_name(sections[i]))) { + return true; + } + } + return false; +} + class SectionedInspectorFilter : public Object { GDCLASS(SectionedInspectorFilter, Object); @@ -232,7 +246,7 @@ void SectionedInspector::update_category_list() { continue; } - if (!filter.is_empty() && pi.name.findn(filter) == -1 && pi.name.replace("/", " ").capitalize().findn(filter) == -1) { + if (!filter.is_empty() && !_property_path_matches(pi.name, filter)) { continue; } |