FGlobalSettingModule& GSettingMod = FModuleManager::LoadModuleChecked<FGlobalSettingModule>(TEXT("GlobalSetting"));
FString userIdStr = FString::FromInt(GSettingMod.GetUserInfo().userId);
FString modelUrl = _ItemModel->_ItemInfo.modelUrl;
if (modelUrl.Find(userIdStr) == INDEX_NONE)
{
return FReply::Unhandled();
}
FMenuBuilder MenuBuilder(true, nullptr);
MenuBuilder.BeginSection("PathFolderMoveCopy", FText::FromString(TEXT("硬装操作")));
{
MenuBuilder.AddMenuEntry(
FText::FromString(TEXT("删除")),
FText::FromString(TEXT("删除该选项")),
FSlateIcon(),
FUIAction(FExecuteAction::CreateLambda([this]() {DeleteThisData(); }))
);
}
MenuBuilder.EndSection();
TSharedPtr< SWindow > Parent = FSlateApplication::Get().GetActiveTopLevelWindow();
if (Parent.IsValid())
{
FSlateApplication::Get().PushMenu(
Parent.ToSharedRef(),
FWidgetPath(),
MenuBuilder.MakeWidget(),
FSlateApplication::Get().GetCursorPos(),
FPopupTransitionEffect(FPopupTransitionEffect::ContextMenu)
);
}