AddMenuExtension is not calling the delegate in UE 5.2. This was working in 5.1.
Code:
static TSharedRef<FExtender> OnExtendContentBrowserAssetSelectionMenu(const TArray<FString>& SelectedPaths)
{
TSharedRef<FExtender> Extender = MakeShared<FExtender>();
Extender->AddMenuExtension(
"PathContextSourceControl",
EExtensionHook::After,
TSharedPtr<FUICommandList>(),
FMenuExtensionDelegate::CreateStatic(&Local::ContentBrowserExtenderFunc, SelectedPaths)
);
return Extender;
}
static void ContentBrowserExtenderFunc(FMenuBuilder& MenuBuilder, const TArray<FString> SelectedPaths)
{
// Is not getting here
}
1 Like
Hi VolHolzknecht,
Try moving over to a class based hook using FMenuExtensionDelegate::CreateSP()
Just search the engine source code for “FMenuExtensionDelegate::CreateSP” to see examples…
as3mbus
(as3mbus)
3
Unreal 5.2 have changed their context menu to not include “PathContextSourceControl”
i’ve searched around for hours and found about this.
You can change it to PathContextBulkOperations if you want to place your extended menu within it’s category
3 Likes
HeyItsDL
(HeyItsDL)
4
Thanks, as3mbus, that worked well. Nice, simple in-line change.