Our goal is to be able to customize the editor icons so we can have a stylish editor that suits our visual style.
When you work with things you like looking at, the work is better.
To be able to customize the editor we will need an editor module. Usually when you create an Unreal C++ project two modules appear a <NameOfYourModule> and a <NameOfYourModule>Editor.
We are going to use this second one.
The setup is not difficult. We will simply add some extra lines on the StartupModule function of this Editor Module to assign our new icons.
The first thing we need are the required include files, they are these ones:
After that, we are going to declare a static pointer to the slate style we are going to create on our EditorModule ( there may be a better way to do this, but for now this seems to work )
Now we are ready to write our code, but our code lines can end up being a little longer I prefer to first declare a helper macro to make our lifes easier:
Now we can start writing our code in the StartupModule function. First we are gonna create the new SlateStyleSet, we will continue by defining where our icons are going to be located, then we will set values on this StyleSet for our new icons and finally we are going to register the Slate StyleSet:
We will be missing the module shutdown to clean up the StyleSet, you will be able to find it in the full code example at the end of this post.
And by the way, how it is setup right now our icons are expected to live inside Content/Editor/Slate, but you can modify that with the line SetContentRoot
With that we can finally have the results we want with our icons being customized!
Now its up to you to modify everything in Unreal to use your custom icons.
In theory this same method can be used to modify other Slate images inside Unreal, so feel free to experiment.
As an addendum, here is the full code of the Editor Module to make things easier to follow: