add new experiments with the SGAssetTypeActions_Skeleton
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
FText FSGAssetTypeActions_Skeleton::GetName() const
|
FText FSGAssetTypeActions_Skeleton::GetName() const
|
||||||
{
|
{
|
||||||
return NSLOCTEXT("AssetTypeActions", "AssetTypeActions_Skeleton", "Skeleton");
|
return NSLOCTEXT("AssetTypeActions", "SGAssetTypeActions_Skeleton", "SGSkeleton");
|
||||||
}
|
}
|
||||||
|
|
||||||
FColor FSGAssetTypeActions_Skeleton::GetTypeColor() const
|
FColor FSGAssetTypeActions_Skeleton::GetTypeColor() const
|
||||||
@@ -60,20 +60,50 @@ bool FSGAssetTypeActions_Skeleton::HasActions(const TArray<UObject*>& InObjects)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FSGAssetTypeActions_Skeleton::GetActions(const TArray<UObject*>& InObjects, FToolMenuSection& Section)
|
void FSGAssetTypeActions_Skeleton::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
|
||||||
{
|
{
|
||||||
/*MenuBuilder.AddMenuEntry(
|
const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked<FAssetToolsModule>(TEXT("AssetTools"))};
|
||||||
|
const TSharedPtr<IAssetTypeActions> EngineActions{
|
||||||
|
AssetToolsModule.Get().GetAssetTypeActionsForClass(GetSupportedClass()->GetSuperClass()).Pin()
|
||||||
|
};
|
||||||
|
if (EngineActions.IsValid())
|
||||||
|
{
|
||||||
|
EngineActions->GetActions(InObjects, MenuBuilder);
|
||||||
|
}
|
||||||
|
MenuBuilder.AddMenuEntry(
|
||||||
FText::FromString("Show Message"),
|
FText::FromString("Show Message"),
|
||||||
FText::FromString("Show a message box"),
|
FText::FromString("Show a message box"),
|
||||||
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.ViewOptions"),
|
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.ViewOptions"),
|
||||||
FUIAction(FExecuteAction::CreateRaw(this, &FMyAssetActions::ShowMessage, InObjects))
|
FUIAction(FExecuteAction::CreateLambda(
|
||||||
);*/
|
[&](TArray<UObject*>)-> void
|
||||||
|
{
|
||||||
|
}, InObjects))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FSGAssetTypeActions_Skeleton::GetActions(const TArray<UObject*>& InObjects, FToolMenuSection& Section)
|
||||||
|
{
|
||||||
|
const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked<FAssetToolsModule>(TEXT("AssetTools"))};
|
||||||
|
const TSharedPtr<IAssetTypeActions> EngineActions{
|
||||||
|
AssetToolsModule.Get().GetAssetTypeActionsForClass(GetSupportedClass()->GetSuperClass()).Pin()
|
||||||
|
};
|
||||||
|
if (EngineActions.IsValid())
|
||||||
|
{
|
||||||
|
EngineActions->GetActions(InObjects, Section);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FSGAssetTypeActions_Skeleton::OpenAssetEditor(const TArray<UObject*>& InObjects,
|
void FSGAssetTypeActions_Skeleton::OpenAssetEditor(const TArray<UObject*>& InObjects,
|
||||||
TSharedPtr<IToolkitHost> EditWithinLevelEditor)
|
TSharedPtr<IToolkitHost> EditWithinLevelEditor)
|
||||||
{
|
{
|
||||||
//FAssetTypeActions_Base::OpenAssetEditor(InObjects, EditWithinLevelEditor);
|
const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked<FAssetToolsModule>(TEXT("AssetTools"))};
|
||||||
|
const TSharedPtr<IAssetTypeActions> EngineActions{
|
||||||
|
AssetToolsModule.Get().GetAssetTypeActionsForClass(GetSupportedClass()->GetSuperClass()).Pin()
|
||||||
|
};
|
||||||
|
if (EngineActions.IsValid())
|
||||||
|
{
|
||||||
|
EngineActions->OpenAssetEditor(InObjects, EditWithinLevelEditor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 FSGAssetTypeActions_Skeleton::GetCategories()
|
uint32 FSGAssetTypeActions_Skeleton::GetCategories()
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public:
|
|||||||
virtual FColor GetTypeColor() const override;
|
virtual FColor GetTypeColor() const override;
|
||||||
virtual UClass* GetSupportedClass() const override;
|
virtual UClass* GetSupportedClass() const override;
|
||||||
virtual bool HasActions(const TArray<UObject*>& InObjects) const override;
|
virtual bool HasActions(const TArray<UObject*>& InObjects) const override;
|
||||||
|
virtual void GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder ) override;
|
||||||
virtual void GetActions(const TArray<UObject*>& InObjects, FToolMenuSection& Section) override;
|
virtual void GetActions(const TArray<UObject*>& InObjects, FToolMenuSection& Section) override;
|
||||||
virtual void OpenAssetEditor(
|
virtual void OpenAssetEditor(
|
||||||
const TArray<UObject*>& InObjects,
|
const TArray<UObject*>& InObjects,
|
||||||
|
|||||||
Reference in New Issue
Block a user