1. Create an editor utility BP using the EditorUtilityToolMenuEntry class. This BP will allow us to specify where our button is created, its labels, and its behaviour. There's a little more functionality, but we'll focus on toolbar buttons for now.
2. Set the name and label of your button, and if making a toolbar extension, set the entry type to "Tool Bar Button"
3. Now we need to specify the Menu and Section for the tool menus system to know where to add our button. There's an easy way via the experimental Edit Menu editor!
Firstly, add the following to Config/DefaultEditorPerProjectUserSettings.ini (feel free to create this file)
4. After restarting the editor, you should be able to enable the "Enable Menu Editing" checkbox under the Window menu. This will now show an "Edit Menu" button for menus and toolbars:
5. Click the "Edit Menu" in the level editor toolbar. This shows menus, sections, and buttons along with their corresponding names. In our BP, set our menu to "LevelEditor.LevelEditorToolBar" and section to "Game". This will tell the system to add the button there.
6. Now we can implement our Execute method that will fire off when the button is pressed. In our example, we're just spawning an editor utility widget.
As you can see below, there's also other methods to specify visibility, labels, tooltips, etc. at runtime.
7. Now we need to register our button. We could do this via an editor utility action, however, most of us want the button at added at startup. So... let's add a "Run" custom event to our blueprint, and then add ourself to the tool menu like so:
8. Next, copy a reference to our BP, and add it as a startup object to DefaultEditorPerProjectUserSettings.ini like the picture below:
To clean up the reference, remove the first apostrophe (') and everything before, and the period (.) and everything after.
9. This will create an instance of the specified class on startup and then execute any event called "Run". This is why we're passing in "self" in the "AddMenuEntryObject" method above.
This is super useful, as you can create singletons out of your editor utility blueprints!
10. Icon names can be obtained by hovering over one in the Texture Atlases tool and using the "Used by" names.
To open the texture atlases tool open the widget reflector: Window->Developer Tools->Widget Reflector
Then: Atlases->Display Texture Atlases
11. Most of these are defined in "EditorStyle" and copy the appropriate icon names from the texture atlas view above.
12. Restart the engine and voilà, you now have a make game button!
You can also create submenus, sections, dynamic menus/sections, and a couple of other things... so play around!
Also, kudos to @jack_knobel, he brought this little gold nugget to my attention!
Scratch that, submenus are off the menu! (apologies folks). Check your logs for any types that aren't supported currently.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Struggling to keep track of name/string values in @UnrealEngine for your game logic? Need a lightweight way to standardise those tags? Check out Gameplay Tags!
Any added tag can be viewed from the Gameplay Tags window in Project Settings. Any tag that you add will be stored centrally, promoting reuse and will prevent you (or your team) from any pesky spelling mistakes. You can even store them in separate .ini files!
If later, you decide "Nah, that was a terrible name!", you can just rename the tag, and let the system redirect any assets using the old tag to the new one!
Don't know what #UE4's Asset Registry is? Wondering how to query asset data _without_ the cost of loading that asset?! Well, look no further, time for a #UETips tweetorial!
The Asset Registry caches metadata about assets under the hood of UE, and can be used to query this metadata without loading assets.
The editor uses it for gathering references, data validation, the content browser's advanced search syntax (linked), etc. docs.unrealengine.com/en-US/Engine/C…
However, the Asset Registry can be used at runtime! When your game is cooked, asset registry data is serialised with your packages; when a package is mounted, the asset registry will load that data.
In fact, Robo Recall uses the asset registry to query packaged mods!
Ever wondered how to define your own Data Validation rules with Editor Utility Blueprints? Here's an example to validate that material asset names are prefixed with "M_".