Hi everyone!
I’m currently writing a details panel customization of two structs and I’ve run into a quite peculiar problem: I can’t get struct properties of type FGameplayTag to show up in my customized panel.
Code of UStruct:
USTRUCT(BlueprintType)
struct FRelationEntry : public FTableRowBase
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(Categories="Faction"))
FGameplayTag Factions;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EHostility Hostility;
};
Code of customization:
void FRelationEntryCustomization::CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
{
HeaderRow.ValueContent()
.MinDesiredWidth(800)
.VAlign(VAlign_Fill)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.AutoWidth()
.HAlign(HAlign_Left)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.VAlign(VAlign_Center)
.AutoWidth()
.Padding(10.0f, 0.0f, 10.0f, 0.0f)
[
SNew(STextBlock)
.Text(FText::FromString("Faction"))
]
+ SHorizontalBox::Slot()
.Padding(0.0f, 0.0f, 40.0f, 0.0f)
[
SNew(SBox)
.MinDesiredWidth(300)
[
SNew(SProperty, StructPropertyHandle.Get().GetChildHandle(0))
.ShouldDisplayName(false)
]
]
]
+ SHorizontalBox::Slot()
.AutoWidth()
.HAlign(HAlign_Left)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.VAlign(VAlign_Center)
.AutoWidth()
.Padding(10.0f, 0.0f, 10.0f, 0.0f)
[
SNew(STextBlock)
.Text(FText::FromString("Relation"))
]
+ SHorizontalBox::Slot()
.Padding(0.0f, 0.0f, 40.0f, 0.0f)
[
SNew(SBox)
.MinDesiredWidth(300)
[
SNew(SProperty, StructPropertyHandle.Get().GetChildHandle(1))
.ShouldDisplayName(false)
]
]
]
];
}
Result:
As you can see, the UEnum property shows up perfectly fine - as do, for example, UObject references, bools and everything else. The only type of property that I couldn’t get to display their native property editing widget is FGameplayTag.
I’d be really glad if someone could point me in the right direction.
Thank you very much in advance!