Add searchable quick add actor popup #3026
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Actor.adder.demo.1.mp4
This adds a way to quickly add an actor to the scene by searching for its name, similar to Godots Add Node dialog (Ctrl + A).
I refactored the content finding popup into searchable editor popup, which as a few override-able methods to handle searching and creating results. I think this may be useful for adding similar dialogs, like for example a command palette, in the future.
This changes nothing from how the user interacts with the popup(s), the only thing it adds is an icon to better differentiate between different popups.
There now also is a base class for the items that are displayed in the results list if the popup.
I also added a parent type argument to the
CreateParentForSelectedActorsmethod. This allows for a Create parent for selected actors option in theActorAdderPopupItems popup menu.The main part that this pr adds is the
ActorAdderPopupItem. It searches for actor types and displays them in a list. When the user hits the enter key, the selected item/ actor will be added to the scene. If no actor in the scene is selected, it will be added to the root of the scene, if one or more actors are selected, the actor will be added to the first scene.There also is an option to create a prefab with the current actor type as a root in the popup menu.
Code reviews are highly welcome. Feel free to nitpick and whatever :)
KNOWN ISSUES
TODO: