Created
January 14, 2022 15:21
-
-
Save RootKiller/8e1d46c973674ff7af3f9c1e8ecdb8f0 to your computer and use it in GitHub Desktop.
Unreal Engine - Move property category in details panel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright XYZ. All Rights Reserved. | |
#include "YourActorDetailsCustomization.h" | |
#include "DetailLayoutBuilder.h" | |
void FYourActorClassDetailsCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailLayout) | |
{ | |
// Category Name is display name of Category you want to move | |
// ECategoryPriority is "how high" it should be. | |
DetailLayout.EditCategory("Category Name", FText::GetEmpty(), ECategoryPriority::Important); | |
} | |
TSharedRef<IDetailCustomization> FYourActorClassDetailsCustomization::MakeInstance() | |
{ | |
return MakeShareable(new FYourActorClassDetailsCustomization); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright XYZ. All Rights Reserved. | |
#pragma once | |
#include "CoreMinimal.h" | |
#include "IDetailCustomization.h" | |
class FYourActorClassDetailsCustomization : public IDetailCustomization | |
{ | |
public: | |
// Makes a new instance of this detail layout class | |
static TSharedRef<IDetailCustomization> MakeInstance(); | |
// IDetailCustomization interface | |
virtual void CustomizeDetails(IDetailLayoutBuilder& DetailLayout) override; | |
// End of IDetailCustomization interface | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "YourEditorModule.h" | |
// .... your code | |
#include "YourActorClassDetailsCustomization.h" | |
#include "YourActor.h" | |
// .... your code | |
void FYourEditorModule::StartupModule() | |
{ | |
// .... your code | |
// Register the details customizations | |
{ | |
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor"); | |
PropertyModule.RegisterCustomClassLayout( AYourActor::StaticClass()->GetFName(), FOnGetDetailCustomizationInstance::CreateStatic( &FYourActorClassDetailsCustomization::MakeInstance ) ); | |
PropertyModule.NotifyCustomizationModuleChanged(); | |
} | |
// .... your code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment