Creating new toolbar buttons

If you have created a custom tool or window for display within the editor, you probably need some way to let the user make it appear. The easiest way to do this is to create a toolbar customization that adds a new toolbar button, and have it display your window when clicked.

Create a new engine module by following the previous recipe, as we'll need it to initialize our toolbar customization.

How to do it…

  1. Create a new header file, and insert the following class declaration:
    #pragma once #include "Commands.h" #include "EditorStyleSet.h" /** * */ class FCookbookCommands : public TCommands<FCookbookCommands> { public: FCookbookCommands() :TCommands<FCookbookCommands>(FName(TEXT("UE4_Cookbook")), FText::FromString("Cookbook ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.