Customize detail panel default


So I am customizing my struct’s details panel but there is one variable that I want to appear as normal/default (as if I didn’t override CustomizeHeader).

The variable TWeakObjectPtr Doorway is the variable that should appear as default, with the object picker and everything.

How do I make it default?
I know that TWeakObjectPtr uses SDetailSingleItemRow widget and FDetailItemNode creates that widget.

Here is some code if you like to see:

struct FDoorwayTeleport

	TWeakObjectPtr<class ADoorway> Doorway; // <--------- This should appear as normal/default

	FString OtherLevelName; // I want to customize these

	FString OtherLevelDoorwayID; // I want to customize these


void FDoorwayTeleportCustomization::CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
	uint32 NumChildren;

	for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ++ChildIndex)
		const TSharedRef< IPropertyHandle > ChildHandle = StructPropertyHandle->GetChildHandle(ChildIndex).ToSharedRef();

		if (ChildHandle->GetProperty()->GetName() == TEXT("Doorway"))
			DoorwayHandle = ChildHandle;

    // How do I pass DoorwayHandle as default?

I haven’t had to do this with a UStruct, but with something that is UObject derived, you can override PostInitProperties() to set a default value if it wasn’t set by the user

Are you intending to display it inline in the header, rather than in the drop down child area? In the child area it’s very easy, just call IDetailChildrenBuilder::AddChildProperty(DoorwayHandle).

If you need it in the header, it’s not clear how exactly you want it to be positioned, but I guess something like this:

    // You could use CreatePropertyNameWidget() here too and put them both into a box

If you need more control, look at SProperty. There’s some info here.

That worked! Thank you