clean up and remove the redundant asset type actions no longer required by the senseglove sockets editor
This commit is contained in:
@@ -1,116 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2024 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SGEditor/SGAssetTypeActions_SkeletalMesh.h"
|
||||
|
||||
#include "Toolkits/IToolkitHost.h"
|
||||
#include "ToolMenuSection.h"
|
||||
#include "UObject/Class.h"
|
||||
#include "UObject/Object.h"
|
||||
|
||||
FText FSGAssetTypeActions_SkeletalMesh::GetName() const
|
||||
{
|
||||
return NSLOCTEXT("AssetTypeActions", "SGAssetTypeActions_SkeletalMesh", "SGSkeletalMesh");
|
||||
}
|
||||
|
||||
FColor FSGAssetTypeActions_SkeletalMesh::GetTypeColor() const
|
||||
{
|
||||
return FColor(105, 181, 205);
|
||||
}
|
||||
|
||||
UClass* FSGAssetTypeActions_SkeletalMesh::GetSupportedClass() const
|
||||
{
|
||||
return USkeletalMesh::StaticClass();
|
||||
}
|
||||
|
||||
bool FSGAssetTypeActions_SkeletalMesh::HasActions(const TArray<UObject*>& InObjects) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void FSGAssetTypeActions_SkeletalMesh::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
|
||||
{
|
||||
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 a message box"),
|
||||
FSlateIcon{FAppStyle::GetAppStyleSetName(), "LevelEditor.ViewOptions"},
|
||||
FUIAction{
|
||||
FExecuteAction::CreateLambda(
|
||||
[&](TArray<UObject*>)-> void
|
||||
{
|
||||
}, InObjects)
|
||||
},
|
||||
NAME_None,
|
||||
EUserInterfaceActionType::Button,
|
||||
NAME_None);
|
||||
}
|
||||
|
||||
void FSGAssetTypeActions_SkeletalMesh::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_SkeletalMesh::OpenAssetEditor(const TArray<UObject*>& InObjects,
|
||||
TSharedPtr<IToolkitHost> 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_SkeletalMesh::GetCategories()
|
||||
{
|
||||
return EAssetTypeCategories::Animation;
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2024 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SGEditor/SGAssetTypeActions_Skeleton.h"
|
||||
|
||||
#include "Toolkits/IToolkitHost.h"
|
||||
#include "ToolMenuSection.h"
|
||||
#include "UObject/Class.h"
|
||||
#include "UObject/Object.h"
|
||||
|
||||
FText FSGAssetTypeActions_Skeleton::GetName() const
|
||||
{
|
||||
return NSLOCTEXT("AssetTypeActions", "SGAssetTypeActions_Skeleton", "SGSkeleton");
|
||||
}
|
||||
|
||||
FColor FSGAssetTypeActions_Skeleton::GetTypeColor() const
|
||||
{
|
||||
return FColor(105, 181, 205);
|
||||
}
|
||||
|
||||
UClass* FSGAssetTypeActions_Skeleton::GetSupportedClass() const
|
||||
{
|
||||
return USkeleton::StaticClass();
|
||||
}
|
||||
|
||||
bool FSGAssetTypeActions_Skeleton::HasActions(const TArray<UObject*>& InObjects) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void FSGAssetTypeActions_Skeleton::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
|
||||
{
|
||||
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 a message box"),
|
||||
FSlateIcon{FAppStyle::GetAppStyleSetName(), "LevelEditor.ViewOptions"},
|
||||
FUIAction{
|
||||
FExecuteAction::CreateLambda(
|
||||
[&](TArray<UObject*>)-> void
|
||||
{
|
||||
}, InObjects)
|
||||
},
|
||||
NAME_None,
|
||||
EUserInterfaceActionType::Button,
|
||||
NAME_None);
|
||||
}
|
||||
|
||||
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,
|
||||
TSharedPtr<IToolkitHost> 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()
|
||||
{
|
||||
return EAssetTypeCategories::Animation;
|
||||
}
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "ISkeletonEditorModule.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
// #include "SGEditor/SGAssetTypeActions_Skeleton.h"
|
||||
#include "SGEditor/SGPluginStyle.h"
|
||||
#include "SGEditor/SGSocketsEditorCommands.h"
|
||||
|
||||
@@ -92,7 +91,6 @@ FSGSocketsEditor::~FSGSocketsEditor() = default;
|
||||
|
||||
void FSGSocketsEditor::Initialize() const
|
||||
{
|
||||
//RegisterAssetTypeActions();
|
||||
RegisterCommands();
|
||||
ExtendMenu();
|
||||
ExtendToolbar();
|
||||
@@ -103,19 +101,6 @@ void FSGSocketsEditor::Deinitialize() const
|
||||
UnregisterCommands();
|
||||
}
|
||||
|
||||
void FSGSocketsEditor::RegisterAssetTypeActions() const
|
||||
{
|
||||
// if (Pimpl->AssetActions.IsValid())
|
||||
// {
|
||||
// Pimpl->AssetActions.Reset();
|
||||
// }
|
||||
// Pimpl->AssetActions = MakeShared<FSGAssetTypeActions_Skeleton>();
|
||||
//
|
||||
// IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
|
||||
//
|
||||
// AssetTools.RegisterAssetTypeActions(Pimpl->AssetActions.ToSharedRef());
|
||||
}
|
||||
|
||||
void FSGSocketsEditor::RegisterCommands() const
|
||||
{
|
||||
if (Pimpl->EditorCommands.IsValid())
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2024 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AssetTypeActions_Base.h"
|
||||
#include "Containers/Array.h"
|
||||
#include "Internationalization/Text.h"
|
||||
#include "Math/Color.h"
|
||||
#include "HAL/Platform.h"
|
||||
#include "Templates/SharedPointer.h"
|
||||
#include "Toolkits/IToolkit.h"
|
||||
#include "ToolMenuSection.h"
|
||||
#include "UObject/Object.h"
|
||||
|
||||
class FMenuBuilder;
|
||||
class IToolkitHost;
|
||||
class UClass;
|
||||
class UObject;
|
||||
|
||||
class SENSEGLOVEEDITOR_API FSGAssetTypeActions_SkeletalMesh : public FAssetTypeActions_Base
|
||||
{
|
||||
public:
|
||||
virtual FText GetName() const override;
|
||||
virtual FColor GetTypeColor() const override;
|
||||
virtual UClass* GetSupportedClass() 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 OpenAssetEditor(
|
||||
const TArray<UObject*>& InObjects,
|
||||
TSharedPtr<IToolkitHost> EditWithinLevelEditor = TSharedPtr<IToolkitHost>()) override;
|
||||
virtual uint32 GetCategories() override;
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2024 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AssetTypeActions_Base.h"
|
||||
#include "Containers/Array.h"
|
||||
#include "Internationalization/Text.h"
|
||||
#include "Math/Color.h"
|
||||
#include "HAL/Platform.h"
|
||||
#include "Templates/SharedPointer.h"
|
||||
#include "Toolkits/IToolkit.h"
|
||||
#include "ToolMenuSection.h"
|
||||
#include "UObject/Object.h"
|
||||
|
||||
class FMenuBuilder;
|
||||
class IToolkitHost;
|
||||
class UClass;
|
||||
class UObject;
|
||||
|
||||
class SENSEGLOVEEDITOR_API FSGAssetTypeActions_Skeleton : public FAssetTypeActions_Base
|
||||
{
|
||||
public:
|
||||
virtual FText GetName() const override;
|
||||
virtual FColor GetTypeColor() const override;
|
||||
virtual UClass* GetSupportedClass() 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 OpenAssetEditor(
|
||||
const TArray<UObject*>& InObjects,
|
||||
TSharedPtr<IToolkitHost> EditWithinLevelEditor = TSharedPtr<IToolkitHost>()) override;
|
||||
virtual uint32 GetCategories() override;
|
||||
};
|
||||
@@ -62,8 +62,6 @@ public:
|
||||
void Initialize() const;
|
||||
void Deinitialize() const;
|
||||
|
||||
void RegisterAssetTypeActions() const;
|
||||
|
||||
void RegisterCommands() const;
|
||||
void UnregisterCommands() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user