Skip to content

Instantly share code, notes, and snippets.

@RootKiller
Created January 14, 2022 15:21
Show Gist options
  • Save RootKiller/8e1d46c973674ff7af3f9c1e8ecdb8f0 to your computer and use it in GitHub Desktop.
Save RootKiller/8e1d46c973674ff7af3f9c1e8ecdb8f0 to your computer and use it in GitHub Desktop.
Unreal Engine - Move property category in details panel
// 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);
}
// 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
};
#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