Sorry for my poor English.
I’m learning how to make a plugin.
I Try to get content browser and add some menu,here is the code:
auto ContentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>(TEXT("ContentBrowser"));
ContentBrowserModule.GetAllAssetViewContextMenuExtenders().Add(FContentBrowserMenuExtender_SelectedAssets::CreateLambda([=](const TArray<FAssetData>& SelectedAssets)
{
TSharedRef<FExtender> Extender(new FExtender);
if (SelectedAssets.Num() > 0 && SelectedAssets[0].AssetClass.ToString().Contains("Material"))
{
Extender->AddMenuExtension("MyFirstPlugin", EExtensionHook::After, nullptr, FMenuExtensionDelegate::CreateLambda([=](FMenuBuilder& MenuBuilder)
{
MenuBuilder.AddMenuEntry(
NSLOCTEXT("NSLT_MyFirstPlugin","MyFirstPlugin_Menu","MyFirstPlugin_Menu"),
NSLOCTEXT("NSLT_MyFirstPlugin", "This_is_my_Tooltip", "This is my Tooltip"),FSlateIcon(),FUIAction());
MenuBuilder.AddMenuSeparator();
}));
}
return Extender;
}));
when I try to compile it I got this Error:
I Try to Add “ContentBrowser” to Build.cs but it doesn’t work:
How can I Fix it?