So I have made a custom project plugin which now works via command console and I would like to make some UI functionality for it by extending the editor.
What I would like to do is add a new menu item next to ‘help’ which has its own items like ‘settings’ like the picture below. I am able to add buttons to the toolbar and anywhere in the existing menus like file, edit, help but not create a completely new menu entry. How would I do this?
Then when I press settings, I would like to have a pop up window where I can set certain properties much like the detail PropertyEditor but a lot simpler:
I tried following a live stream on YouTube about extending the editor but it is going a bit too fast for me as I am a beginner in UE4 and I’m getting compile errors with the code shown there. Is there someone who can help me?
What you are wanting to do is extend the “Main Menu Bar” for the UE4 Editor. To understand how to do this, let us look at some code to begin with to see how it is created in the UE4 Editor Source Code. For simplicity’s sake, we will go top down from the highest module and trace the code to see how it is constructed.
So, what does all of that mean? Well, now you have all the examples you need to build a menu option tab in the main frame of the level editor as well as look at the code to see how it builds the menu options and the action lists for when an option is clicked. Exciting right! So, how to add it after the Help tab? You need to grab the mainframe module for the level editor and then call the extensibility manager to add a menu extension immediately after the Help button in the Help section.
The key here is the extender that we want to tack the menu option onto.
Thank you for the extensive answer! Just what I needed to push me in the right direction:) I got my sub menu working now next to the help menu, now only for the settings window. I think I get how it works with the other commands so I should be fine from here. Thanks again!
No problem! Always glad to help. It really is extremely useful to go to the source code and find out how the devs did it originally. The hardest part is finding the starting point for all that code. Good luck on the rest of your project!
As far as compatibility, I have not created a custom menu item in Unreal Engine 5. While most of the concepts are the same, there may be breaking changes between 4 and 5. I am currently writing a plugin with a custom editor in 5.0. If I come across this scenario again, I can reply with the steps for version 5.