Hey,
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:
USTRUCT()
struct FDoorwayTeleport
{
GENERATED_BODY()
UPROPERTY(EditAnywhere)
TWeakObjectPtr<class ADoorway> Doorway; // <--------- This should appear as normal/default
UPROPERTY(EditAnywhere)
FString OtherLevelName; // I want to customize these
UPROPERTY(EditAnywhere)
FString OtherLevelDoorwayID; // I want to customize these
FDoorwayTeleport();
};
void FDoorwayTeleportCustomization::CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
{
uint32 NumChildren;
StructPropertyHandle->GetNumChildren(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?
}