for beginners like me, this solution should work : (I am not sure if this way is ok to edit my game module )
my project name MG3, the file MG3.cpp by default is:
#include "MG3.h"
IMPLEMENT_PRIMARY_GAME_MODULE(FDefaultGameModuleImpl, MG3, "MG3");
so I have edited it to the following:
#include "MG3.h"
#ifndef WITH_EDITOR
IMPLEMENT_PRIMARY_GAME_MODULE(FDefaultGameModuleImpl, MG3, "MG3");
#else
#include "SlateStyle.h"
#include "SlateStyleRegistry.h"
class FMyDefaultGameModuleImpl
: public FDefaultGameModuleImpl {
public:
static TSharedPtr< class FSlateStyleSet > StyleSet;
virtual void StartupModule() override {
StyleSet = MakeShareable(new FSlateStyleSet("PlyrOPStyleSet"));
StyleSet->SetContentRoot(FPaths::EngineContentDir() / TEXT("Editor/Slate"));
StyleSet->SetCoreContentRoot(FPaths::EngineContentDir() / TEXT("Slate"));
auto brush = new FSlateImageBrush(
StyleSet->RootToContentDir(TEXT("Icons/AssetIcons/PaperCharacter_64x"), TEXT(".png"))
, FVector2D(64.0f, 64.0f)
);
StyleSet->Set("ClassThumbnail.MPlayerOP", brush);
FSlateStyleRegistry::RegisterSlateStyle(*StyleSet.Get());
}
virtual void ShutdownModule() override {
FSlateStyleRegistry::UnRegisterSlateStyle(*StyleSet.Get());
ensure(StyleSet.IsUnique());
StyleSet.Reset();
}
};
TSharedPtr< FSlateStyleSet > FMyDefaultGameModuleImpl::StyleSet = nullptr;
IMPLEMENT_PRIMARY_GAME_MODULE(FMyDefaultGameModuleImpl, MG3, "MG3");
#endif
MPlayerOP is the class name that I want to change its thumbnail.
thanks for everyone in ue answers ^^ . special thanks to MatzeOGH.