Hi, so I’m working on a tool and I need to display single property in my own custom editor widget.
I have reference to structure that I want to display, the problem is that this struct have customized property layout.
I tried SinglePropertyView but it’s not working with structures, StructureDetailsView is also not working.
Structure I want to display is FGameplayTagContainer. Maybe I should (somehow) create PropertyHandle for this?
UTagSystemComponent *TagSystemComponent = GetTagComponent();
TSharedPtr<IStructureDetailsView> StructureDetailsView;
FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
FDetailsViewArgs DetailsViewArgs;
{
DetailsViewArgs.bAllowSearch = false;
DetailsViewArgs.bHideSelectionTip = true;
DetailsViewArgs.bLockable = false;
DetailsViewArgs.bSearchInitialKeyFocus = true;
DetailsViewArgs.bUpdatesFromSelection = false;
DetailsViewArgs.NotifyHook = nullptr;
DetailsViewArgs.bShowOptions = true;
DetailsViewArgs.bShowModifiedPropertiesOption = false;
DetailsViewArgs.bShowScrollBar = false;
}
FStructureDetailsViewArgs StructureViewArgs;
{
StructureViewArgs.bShowObjects = true;
StructureViewArgs.bShowAssets = true;
StructureViewArgs.bShowClasses = true;
StructureViewArgs.bShowInterfaces = true;
}
FStructOnScope* Struct = new FStructOnScope(FGameplayTagContainer::StaticStruct(), (uint8*)&TagSystemComponent->TagsContainer);
StructureDetailsView = PropertyEditorModule.CreateStructureDetailView(DetailsViewArgs, StructureViewArgs, MakeShareable(Struct));
if (IsValid(TagSystemComponent))
{
ChildSlot
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.HAlign(HAlign_Center)
.AutoWidth()
[
StructureDetailsView->GetWidget()->AsShared()
]
];
}
else
{
ComponentNotFound();
}