|
6 | 6 | #include "DetailWidgetRow.h" |
7 | 7 | #include "KawaiiPhysicsBoneConstraintsDataAsset.h" |
8 | 8 | #include "KawaiiPhysicsLimitsDataAsset.h" |
| 9 | +#include "NotificationManager.h" |
9 | 10 | #include "Selection.h" |
| 11 | +#include "SNotificationList.h" |
10 | 12 | #include "AssetRegistry/AssetRegistryModule.h" |
11 | 13 | #include "Dialogs/DlgPickAssetPath.h" |
12 | 14 | #include "Kismet2/CompilerResultsLog.h" |
@@ -543,6 +545,22 @@ UPackage* UAnimGraphNode_KawaiiPhysics::CreateDataAssetPackage(const FString& Di |
543 | 545 | return CreatePackage(*PackagePath); |
544 | 546 | } |
545 | 547 |
|
| 548 | +void UAnimGraphNode_KawaiiPhysics::ShowExportAssetNotification(UObject* NewAsset, |
| 549 | + FText NotificationText) |
| 550 | +{ |
| 551 | + FNotificationInfo NotificationInfo(NotificationText); |
| 552 | + NotificationInfo.ExpireDuration = 5.0f; |
| 553 | + NotificationInfo.Hyperlink = FSimpleDelegate::CreateLambda([NewAsset]() |
| 554 | + { |
| 555 | + GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->OpenEditorForAsset(NewAsset); |
| 556 | + }); |
| 557 | + NotificationInfo.HyperlinkText = LOCTEXT("OpenCreatedAsset", "Open Created Asset"); |
| 558 | + |
| 559 | + TSharedPtr<SNotificationItem> NotificationItem = FSlateNotificationManager::Get().AddNotification( |
| 560 | + NotificationInfo); |
| 561 | + NotificationItem->SetCompletionState(SNotificationItem::CS_Success); |
| 562 | +} |
| 563 | + |
546 | 564 | void UAnimGraphNode_KawaiiPhysics::ExportLimitsDataAsset() |
547 | 565 | { |
548 | 566 | FString AssetName; |
@@ -588,6 +606,11 @@ void UAnimGraphNode_KawaiiPhysics::ExportLimitsDataAsset() |
588 | 606 |
|
589 | 607 | FAssetRegistryModule::AssetCreated(NewDataAsset); |
590 | 608 | Package->MarkPackageDirty(); |
| 609 | + |
| 610 | + // Add Notification |
| 611 | + FText NotificationText = FText::Format( |
| 612 | + LOCTEXT("ExportedLimitsDataAsset", "Exposted Limits Data Asset: {0}"), FText::FromString(AssetName)); |
| 613 | + ShowExportAssetNotification(NewDataAsset, NotificationText); |
591 | 614 | } |
592 | 615 | } |
593 | 616 |
|
@@ -631,6 +654,12 @@ void UAnimGraphNode_KawaiiPhysics::ExportBoneConstraintsDataAsset() |
631 | 654 |
|
632 | 655 | FAssetRegistryModule::AssetCreated(NewDataAsset); |
633 | 656 | Package->MarkPackageDirty(); |
| 657 | + |
| 658 | + // Add Notification |
| 659 | + FText NotificationText = FText::Format( |
| 660 | + LOCTEXT("ExportedBoneConstraintsDataAsset", "Exposted BoneConstraints Data Asset: {0}"), |
| 661 | + FText::FromString(AssetName)); |
| 662 | + ShowExportAssetNotification(NewDataAsset, NotificationText); |
634 | 663 | } |
635 | 664 | } |
636 | 665 |
|
|
0 commit comments