diff --git a/Source/SenseGloveEditor/Private/SGEditor/SGAssetTypeActions_SkeletalMesh.cpp b/Source/SenseGloveEditor/Private/SGEditor/SGAssetTypeActions_SkeletalMesh.cpp deleted file mode 100644 index 13af91db..00000000 --- a/Source/SenseGloveEditor/Private/SGEditor/SGAssetTypeActions_SkeletalMesh.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file - * - * @author Mamadou Babaei - * - * @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& InObjects) const -{ - return true; -} - -void FSGAssetTypeActions_SkeletalMesh::GetActions(const TArray& InObjects, FMenuBuilder& MenuBuilder) -{ - const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked(TEXT("AssetTools"))}; - const TSharedPtr 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)-> void - { - }, InObjects) - }, - NAME_None, - EUserInterfaceActionType::Button, - NAME_None); -} - -void FSGAssetTypeActions_SkeletalMesh::GetActions(const TArray& InObjects, FToolMenuSection& Section) -{ - const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked(TEXT("AssetTools"))}; - const TSharedPtr EngineActions{ - AssetToolsModule.Get().GetAssetTypeActionsForClass(GetSupportedClass()->GetSuperClass()).Pin() - }; - if (EngineActions.IsValid()) - { - EngineActions->GetActions(InObjects, Section); - } -} - -void FSGAssetTypeActions_SkeletalMesh::OpenAssetEditor(const TArray& InObjects, - TSharedPtr EditWithinLevelEditor) -{ - const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked(TEXT("AssetTools"))}; - const TSharedPtr EngineActions{ - AssetToolsModule.Get().GetAssetTypeActionsForClass(GetSupportedClass()->GetSuperClass()).Pin() - }; - if (EngineActions.IsValid()) - { - EngineActions->OpenAssetEditor(InObjects, EditWithinLevelEditor); - } -} - -uint32 FSGAssetTypeActions_SkeletalMesh::GetCategories() -{ - return EAssetTypeCategories::Animation; -} \ No newline at end of file diff --git a/Source/SenseGloveEditor/Private/SGEditor/SGAssetTypeActions_Skeleton.cpp b/Source/SenseGloveEditor/Private/SGEditor/SGAssetTypeActions_Skeleton.cpp deleted file mode 100644 index 196df2b4..00000000 --- a/Source/SenseGloveEditor/Private/SGEditor/SGAssetTypeActions_Skeleton.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file - * - * @author Mamadou Babaei - * - * @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& InObjects) const -{ - return true; -} - -void FSGAssetTypeActions_Skeleton::GetActions(const TArray& InObjects, FMenuBuilder& MenuBuilder) -{ - const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked(TEXT("AssetTools"))}; - const TSharedPtr 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)-> void - { - }, InObjects) - }, - NAME_None, - EUserInterfaceActionType::Button, - NAME_None); -} - -void FSGAssetTypeActions_Skeleton::GetActions(const TArray& InObjects, FToolMenuSection& Section) -{ - const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked(TEXT("AssetTools"))}; - const TSharedPtr EngineActions{ - AssetToolsModule.Get().GetAssetTypeActionsForClass(GetSupportedClass()->GetSuperClass()).Pin() - }; - if (EngineActions.IsValid()) - { - EngineActions->GetActions(InObjects, Section); - } -} - -void FSGAssetTypeActions_Skeleton::OpenAssetEditor(const TArray& InObjects, - TSharedPtr EditWithinLevelEditor) -{ - const FAssetToolsModule& AssetToolsModule{FModuleManager::LoadModuleChecked(TEXT("AssetTools"))}; - const TSharedPtr EngineActions{ - AssetToolsModule.Get().GetAssetTypeActionsForClass(GetSupportedClass()->GetSuperClass()).Pin() - }; - if (EngineActions.IsValid()) - { - EngineActions->OpenAssetEditor(InObjects, EditWithinLevelEditor); - } -} - -uint32 FSGAssetTypeActions_Skeleton::GetCategories() -{ - return EAssetTypeCategories::Animation; -} \ No newline at end of file diff --git a/Source/SenseGloveEditor/Private/SGEditor/SGSocketsEditor.cpp b/Source/SenseGloveEditor/Private/SGEditor/SGSocketsEditor.cpp index 59e05c6f..1a792996 100644 --- a/Source/SenseGloveEditor/Private/SGEditor/SGSocketsEditor.cpp +++ b/Source/SenseGloveEditor/Private/SGEditor/SGSocketsEditor.cpp @@ -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(); - // - // IAssetTools& AssetTools = FModuleManager::LoadModuleChecked("AssetTools").Get(); - // - // AssetTools.RegisterAssetTypeActions(Pimpl->AssetActions.ToSharedRef()); -} - void FSGSocketsEditor::RegisterCommands() const { if (Pimpl->EditorCommands.IsValid()) diff --git a/Source/SenseGloveEditor/Public/SGEditor/SGAssetTypeActions_SkeletalMesh.h b/Source/SenseGloveEditor/Public/SGEditor/SGAssetTypeActions_SkeletalMesh.h deleted file mode 100644 index 787fce7d..00000000 --- a/Source/SenseGloveEditor/Public/SGEditor/SGAssetTypeActions_SkeletalMesh.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file - * - * @author Mamadou Babaei - * - * @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& InObjects) const override; - virtual void GetActions(const TArray& InObjects, FMenuBuilder& MenuBuilder) override; - virtual void GetActions(const TArray& InObjects, FToolMenuSection& Section) override; - virtual void OpenAssetEditor( - const TArray& InObjects, - TSharedPtr EditWithinLevelEditor = TSharedPtr()) override; - virtual uint32 GetCategories() override; -}; \ No newline at end of file diff --git a/Source/SenseGloveEditor/Public/SGEditor/SGAssetTypeActions_Skeleton.h b/Source/SenseGloveEditor/Public/SGEditor/SGAssetTypeActions_Skeleton.h deleted file mode 100644 index 0408d7b6..00000000 --- a/Source/SenseGloveEditor/Public/SGEditor/SGAssetTypeActions_Skeleton.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file - * - * @author Mamadou Babaei - * - * @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& InObjects) const override; - virtual void GetActions(const TArray& InObjects, FMenuBuilder& MenuBuilder) override; - virtual void GetActions(const TArray& InObjects, FToolMenuSection& Section) override; - virtual void OpenAssetEditor( - const TArray& InObjects, - TSharedPtr EditWithinLevelEditor = TSharedPtr()) override; - virtual uint32 GetCategories() override; -}; \ No newline at end of file diff --git a/Source/SenseGloveEditor/Public/SGEditor/SGSocketsEditor.h b/Source/SenseGloveEditor/Public/SGEditor/SGSocketsEditor.h index 18be3f1c..a77ced79 100644 --- a/Source/SenseGloveEditor/Public/SGEditor/SGSocketsEditor.h +++ b/Source/SenseGloveEditor/Public/SGEditor/SGSocketsEditor.h @@ -62,8 +62,6 @@ public: void Initialize() const; void Deinitialize() const; - void RegisterAssetTypeActions() const; - void RegisterCommands() const; void UnregisterCommands() const;