Skip to content

Conversation

@xxSeys1
Copy link
Contributor

@xxSeys1 xxSeys1 commented Oct 30, 2024

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 CreateParentForSelectedActors method. This allows for a Create parent for selected actors option in the ActorAdderPopupItems 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

  • When right clicking on one of the search results, the search will reset. I roughly know what's causing this, but haven't found a way to fix it yet. This bug was not introduced by me, multiple people could reproduce it in the discord. I'll have another try at fixing it though.

TODO:

  • Do various TODOs in the code
  • Sort files in a more meaningful way and split classes into individual files
  • Add an actor adder popup menu option to add new actor as a child of every selected actor in the scene
  • Find a better shortcut than the current one. I think three keys are too much, if anyone has a better idea, please let me know

@mafiesto4 mafiesto4 added enhancement New feature or request editor labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants