Skip to content

Search Files Dock improvement suggestions #20127

@williamd1k0

Description

@williamd1k0

Hi, I was working on a kind of prototype for a feature request/suggestion.

This suggestion was made by my partner Lucia. She has some knowledge with Unity and is now beginning to use/learn the Godot Engine. She missed a filter system when searching for assets in the FileSystem Dock.

So, (currently) there are 2 types of filters in Unity:

  • Search by Type
    (t:Texture file-name) or (file-name t:Texture)

Note: Unity doesn't support search with extension (eg: file-name.png). ¯\_(シ)_/¯

Search by (Resource) Type is easy to implement, there is no compatibility issue or something else.

  • Search by Label (customizable)
    (l:UI file-name) or (file-name l:UI)
    Search by Label is difficult to implement, it depends on metadata for the labels/tags. It could be stored in .tscn, .import and .tres files but not in scripts files.

Filters can be stackable (as in the GitHub issue search)
(t:Texture l:UI file-name)

photo_2018-07-10_19-56-32


So, I was working on the "Filter by resource type" because it seems useful and is "easy" to implement.
I also added a "Match case" option because it can also be useful.

file-search-dock6

I'm not going to open a PR because I'm still a beginner in C++, I'm actually using the Godot Engine project to study and improve my C++ knowledge :)

Some stuff are hard-coded, such as the Resource type list (I think it should be more interesting if the list is dynamically generated using all the resource types used in the current project).
By the way, in addition to choosing the type in the filter list you can also enter any valid built-in Resource type.

Feel free to check my fork and copy the code. (williamd1k0@af079ab)
Also, as I'm still a beginner, I appreciate any kind of criticism and suggestions about the code :)
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions