本文整理汇总了C++中IDetailLayoutBuilder::HideCategory方法的典型用法代码示例。如果您正苦于以下问题:C++ IDetailLayoutBuilder::HideCategory方法的具体用法?C++ IDetailLayoutBuilder::HideCategory怎么用?C++ IDetailLayoutBuilder::HideCategory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDetailLayoutBuilder
的用法示例。
在下文中一共展示了IDetailLayoutBuilder::HideCategory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CustomizeDetails
/** IDetailCustomization interface */
void FSpeedTreeImportDataDetails::CustomizeDetails(IDetailLayoutBuilder& DetailLayout)
{
CachedDetailBuilder = &DetailLayout;
TArray<TWeakObjectPtr<UObject>> EditingObjects;
DetailLayout.GetObjectsBeingCustomized(EditingObjects);
check(EditingObjects.Num() == 1);
SpeedTreeImportData = Cast<USpeedTreeImportData>(EditingObjects[0].Get());
if (SpeedTreeImportData == nullptr)
{
return;
}
//We have to hide FilePath category
DetailLayout.HideCategory(FName(TEXT("File Path")));
//Mesh category Must be the first category (Important)
DetailLayout.EditCategory(FName(TEXT("Mesh")), FText::GetEmpty(), ECategoryPriority::Important);
//Get the Materials category
IDetailCategoryBuilder& MaterialsCategoryBuilder = DetailLayout.EditCategory(FName(TEXT("Materials")));
TArray<TSharedRef<IPropertyHandle>> MaterialCategoryDefaultProperties;
MaterialsCategoryBuilder.GetDefaultProperties(MaterialCategoryDefaultProperties);
//We have to make the logic for vertex processing
TSharedRef<IPropertyHandle> MakeMaterialsCheckProp = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(USpeedTreeImportData, MakeMaterialsCheck));
MakeMaterialsCheckProp->SetOnPropertyValueChanged(FSimpleDelegate::CreateSP(this, &FSpeedTreeImportDataDetails::OnForceRefresh));
TSharedRef<IPropertyHandle> IncludeVertexProcessingCheckProp = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(USpeedTreeImportData, IncludeVertexProcessingCheck));
IncludeVertexProcessingCheckProp->SetOnPropertyValueChanged(FSimpleDelegate::CreateSP(this, &FSpeedTreeImportDataDetails::OnForceRefresh));
//Hide all properties, we will show them in the correct order with the correct grouping
for (TSharedRef<IPropertyHandle> Handle : MaterialCategoryDefaultProperties)
{
DetailLayout.HideProperty(Handle);
}
MaterialsCategoryBuilder.AddProperty(MakeMaterialsCheckProp);
if (SpeedTreeImportData->MakeMaterialsCheck)
{
for (TSharedRef<IPropertyHandle> Handle : MaterialCategoryDefaultProperties)
{
const FString& MetaData = Handle->GetMetaData(TEXT("EditCondition"));
if (MetaData.Compare(TEXT("MakeMaterialsCheck")) == 0 && IncludeVertexProcessingCheckProp->GetProperty() != Handle->GetProperty())
{
MaterialsCategoryBuilder.AddProperty(Handle);
}
}
IDetailGroup& VertexProcessingGroup = MaterialsCategoryBuilder.AddGroup(FName(TEXT("VertexProcessingGroup")), LOCTEXT("VertexProcessingGroup_DisplayName", "Vertex Processing"), false, true);
VertexProcessingGroup.AddPropertyRow(IncludeVertexProcessingCheckProp);
for (TSharedRef<IPropertyHandle> Handle : MaterialCategoryDefaultProperties)
{
const FString& MetaData = Handle->GetMetaData(TEXT("EditCondition"));
if (MetaData.Compare(TEXT("IncludeVertexProcessingCheck")) == 0)
{
VertexProcessingGroup.AddPropertyRow(Handle);
}
}
}
}