I’m trying to add some buttons and custom info to the details panel.
As a first test, I created a custom IDetailCustomization that added a button into the “Transform” category. It worked but it removed (hid?) the Location, Rotation and Scale properties from the details panel. Which lead me to the conclusion I shouldn’t mess with existing categories yet.
So, I modified my IDetailCustomization to create a new category instead of using an existing one, and add my button to it. Once again, it worked! But the transform properties haven’t come back.
void FECMADetailCustomization::CustomizeDetails(IDetailLayoutBuilder & DetailBuilder)
{
IDetailCategoryBuilder& Category = DetailBuilder.EditCategory("ECMA", FText::FromString("ECMA"), ECategoryPriority::Variable);
Category.AddCustomRow(LOCTEXT("RowSearchName", "TestButton"))
.NameContent()
[
SNew(STextBlock)
.Text(LOCTEXT("DetailName", "Click Me -->"))
.Font(IDetailLayoutBuilder::GetDetailFont())
]
.ValueContent()
[
SNew(SButton)
.Text(LOCTEXT("ButtonText", "CLICK HERE!!"))
.HAlign(HAlign_Center)
.ToolTipText(LOCTEXT("ButtonTooltip", "Click and see ;)"))
];
}
And this is how I register the DetailCustomization:
void FECMADetailsModule::StartupModule()
{
UE_LOG(LogTemp, Warning, TEXT("ECMA Module Startup"));
#if WITH_EDITOR
UE_LOG(LogTemp, Error, TEXT("ECMA Module WITH_EDITOR"));
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
PropertyModule.RegisterCustomClassLayout("Actor", FOnGetDetailCustomizationInstance::CreateStatic(&FECMADetailCustomization::MakeInstance));
#endif
}
I already tried cleaning the project and rebuilding.