Plugin - FGameplayTag property in custom details panel

Hi everyone!
I’m currently writing on a plugin and need to customize the details panel of a UStruct. The goal is to rearrange the properties of said struct to make it a bit more readable.
As you can see, the other property of this struct (UEnum “Relation”) behaves/shows up as expected, but the FGameplayTag “Faction” doesn’t:

Here’s the code of the UStruct:


[SPOILER]


 USTRUCT(BlueprintType)
  struct FRelationEntry : public FTableRowBase
  {
      GENERATED_BODY()
        UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(Categories="Faction"))
      FGameplayTag Factions;
        UPROPERTY(EditAnywhere, BlueprintReadWrite)
      EHostility Relation;
  };
 

[/SPOILER]

And here’s the slate code for the customization:


[SPOILER]


 void FRelationEntryCustomization::CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
  {
  HeaderRow.NameContent()
  
  StructPropertyHandle->CreatePropertyNameWidget(FText::FromString("New property header name"))
  ];

  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)
  ]
  ]
  ]
  ];
  }
 

[/SPOILER]

The customization works with every other type of property I’ve tried it on like a charm, it’s only the FGameplayTag that gives me this kind of problem.
I’d be really glad if anyone could point me in the right direction.

Thanks in advance! :slight_smile:

Did you ever find a solution for this?

GameplayTags is a plugin which register its own set of type customizations.
It’s probably a conflict between your widget and the widget classes that the GameplayTag plugin registers.

You could look into GameplayTag plugin and copy the code that builds widgets for that class.

1 Like