本文整理汇总了C++中IDetailLayoutBuilder::HideProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ IDetailLayoutBuilder::HideProperty方法的具体用法?C++ IDetailLayoutBuilder::HideProperty怎么用?C++ IDetailLayoutBuilder::HideProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDetailLayoutBuilder
的用法示例。
在下文中一共展示了IDetailLayoutBuilder::HideProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CustomizeDetails
void FDestructibleMeshDetails::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
//we always hide bodysetup as it's not useful in this editor
TSharedPtr<IPropertyHandle> BodySetupHandler = DetailBuilder.GetProperty("BodySetup");
if (BodySetupHandler.IsValid())
{
DetailBuilder.HideProperty(BodySetupHandler);
}
//rest of customization is just moving stuff out of DefaultDestructibleParameters so it's nicer to view
TSharedPtr<IPropertyHandle> DefaultParams = DetailBuilder.GetProperty("DefaultDestructibleParameters");
if (DefaultParams.IsValid() == false)
{
return;
}
AddStructToDetails("Damage", "DefaultDestructibleParameters.DamageParameters", DetailBuilder);
AddStructToDetails("Damage", "DefaultDestructibleParameters.AdvancedParameters", DetailBuilder, true, true);
AddStructToDetails("Debris", "DefaultDestructibleParameters.DebrisParameters", DetailBuilder);
AddStructToDetails("Flags", "DefaultDestructibleParameters.Flags", DetailBuilder);
AddStructToDetails("HierarchyDepth", "DefaultDestructibleParameters.SpecialHierarchyDepths", DetailBuilder);
AddStructToDetails("HierarchyDepth", "DefaultDestructibleParameters.DepthParameters", DetailBuilder, false, true);
//hide the default params as we've taken everything out of it
DetailBuilder.HideProperty(DefaultParams);
}
示例2: CustomizeDetails
void FBlackboardDataDetails::CustomizeDetails( IDetailLayoutBuilder& DetailLayout )
{
// First hide all keys
DetailLayout.HideProperty(TEXT("Keys"));
DetailLayout.HideProperty(TEXT("ParentKeys"));
// Now show only the currently selected key
bool bIsInherited = false;
int32 CurrentSelection = INDEX_NONE;
if(OnGetSelectedBlackboardItemIndex.IsBound())
{
CurrentSelection = OnGetSelectedBlackboardItemIndex.Execute(bIsInherited);
}
if(CurrentSelection >= 0)
{
TSharedPtr<IPropertyHandle> KeysHandle = bIsInherited ? DetailLayout.GetProperty(TEXT("ParentKeys")) : DetailLayout.GetProperty(TEXT("Keys"));
check(KeysHandle.IsValid());
uint32 NumChildKeys = 0;
KeysHandle->GetNumChildren(NumChildKeys);
if((uint32)CurrentSelection < NumChildKeys)
{
TSharedPtr<IPropertyHandle> KeyHandle = KeysHandle->GetChildHandle((uint32)CurrentSelection);
IDetailCategoryBuilder& DetailCategoryBuilder = DetailLayout.EditCategory("Key");
TSharedPtr<IPropertyHandle> EntryNameProperty = KeyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBlackboardEntry, EntryName));
DetailCategoryBuilder.AddCustomRow(LOCTEXT("EntryNameLabel", "Entry Name"))
.NameContent()
[
EntryNameProperty->CreatePropertyNameWidget()
]
.ValueContent()
[
SNew(SHorizontalBox)
.IsEnabled(true)
+SHorizontalBox::Slot()
[
EntryNameProperty->CreatePropertyValueWidget()
]
];
#if WITH_EDITORONLY_DATA
// TSharedPtr<IPropertyHandle> EntryDescriptionHandle = ElementProperty->GetChildHandle("EntryDescription");
TSharedPtr<IPropertyHandle> EntryDescriptionHandle = KeyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBlackboardEntry, EntryDescription));
DetailCategoryBuilder.AddProperty(EntryDescriptionHandle);
#endif
TSharedPtr<IPropertyHandle> KeyTypeProperty = KeyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBlackboardEntry, KeyType));
DetailCategoryBuilder.AddProperty(KeyTypeProperty);
TSharedPtr<IPropertyHandle> bInstanceSyncedProperty = KeyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBlackboardEntry, bInstanceSynced));
DetailCategoryBuilder.AddProperty(bInstanceSyncedProperty);
}
}
}
示例3: 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);
}
}
}
}
示例4: BuildTextureSection
void FSpriteDetailsCustomization::BuildTextureSection(IDetailCategoryBuilder& SpriteCategory, IDetailLayoutBuilder& DetailLayout)
{
// Grab information about the material
TSharedPtr<IPropertyHandle> DefaultMaterialProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UPaperSprite, DefaultMaterial));
FText SourceTextureOverrideLabel;
if (DefaultMaterialProperty.IsValid())
{
UObject* DefaultMaterialAsObject;
if (DefaultMaterialProperty->GetValue(/*out*/ DefaultMaterialAsObject) == FPropertyAccess::Success)
{
if (UMaterialInterface* DefaultMaterialInterface = Cast<UMaterialInterface>(DefaultMaterialAsObject))
{
if (UMaterial* DefaultMaterial = DefaultMaterialInterface->GetMaterial())
{
// Get a list of sprite samplers
TArray<const UMaterialExpressionSpriteTextureSampler*> SpriteSamplerExpressions;
DefaultMaterial->GetAllExpressionsOfType(/*inout*/ SpriteSamplerExpressions);
// Turn that into a set of labels
for (const UMaterialExpressionSpriteTextureSampler* Sampler : SpriteSamplerExpressions)
{
if (!Sampler->SlotDisplayName.IsEmpty())
{
if (Sampler->bSampleAdditionalTextures)
{
AdditionalTextureLabels.FindOrAdd(Sampler->AdditionalSlotIndex) = Sampler->SlotDisplayName;
}
else
{
SourceTextureOverrideLabel = Sampler->SlotDisplayName;
}
}
}
}
}
}
}
// Create the base texture widget
TSharedPtr<IPropertyHandle> SourceTextureProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UPaperSprite, SourceTexture));
DetailLayout.HideProperty(SourceTextureProperty);
SpriteCategory.AddCustomRow(SourceTextureProperty->GetPropertyDisplayName())
.NameContent()
[
CreateTextureNameWidget(SourceTextureProperty, SourceTextureOverrideLabel)
]
.ValueContent()
.MaxDesiredWidth(TOptional<float>())
[
SourceTextureProperty->CreatePropertyValueWidget()
];
// Create the additional textures widget
TSharedPtr<IPropertyHandle> AdditionalSourceTexturesProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UPaperSprite, AdditionalSourceTextures));
TSharedRef<FDetailArrayBuilder> AdditionalSourceTexturesBuilder = MakeShareable(new FDetailArrayBuilder(AdditionalSourceTexturesProperty.ToSharedRef()));
AdditionalSourceTexturesBuilder->OnGenerateArrayElementWidget(FOnGenerateArrayElementWidget::CreateSP(this, &FSpriteDetailsCustomization::GenerateAdditionalTextureWidget));
SpriteCategory.AddCustomBuilder(AdditionalSourceTexturesBuilder);
}
示例5: CustomizeDetails
void FBodySetupDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder )
{
// Customize collision section
{
if ( DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(UBodySetup, DefaultInstance))->IsValidHandle() )
{
DetailBuilder.GetObjectsBeingCustomized(ObjectsCustomized);
TSharedPtr<IPropertyHandle> BodyInstanceHandler = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(UBodySetup, DefaultInstance));
const bool bInPhat = ObjectsCustomized.Num() && (Cast<USkeletalBodySetup>(ObjectsCustomized[0].Get()) != nullptr);
if (bInPhat)
{
TSharedRef<IPropertyHandle> AsyncEnabled = BodyInstanceHandler->GetChildHandle(GET_MEMBER_NAME_CHECKED(FBodyInstance, bUseAsyncScene)).ToSharedRef();
AsyncEnabled->MarkHiddenByCustomization();
}
BodyInstanceCustomizationHelper = MakeShareable(new FBodyInstanceCustomizationHelper(ObjectsCustomized));
BodyInstanceCustomizationHelper->CustomizeDetails(DetailBuilder, DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(UBodySetup, DefaultInstance)));
IDetailCategoryBuilder& CollisionCategory = DetailBuilder.EditCategory("Collision");
DetailBuilder.HideProperty(BodyInstanceHandler);
TSharedPtr<IPropertyHandle> CollisionTraceHandler = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(UBodySetup, CollisionTraceFlag));
DetailBuilder.HideProperty(CollisionTraceHandler);
// add physics properties to physics category
uint32 NumChildren = 0;
BodyInstanceHandler->GetNumChildren(NumChildren);
static const FName CollisionCategoryName(TEXT("Collision"));
// add all properties of this now - after adding
for (uint32 ChildIndex=0; ChildIndex < NumChildren; ++ChildIndex)
{
TSharedPtr<IPropertyHandle> ChildProperty = BodyInstanceHandler->GetChildHandle(ChildIndex);
FName CategoryName = FObjectEditorUtils::GetCategoryFName(ChildProperty->GetProperty());
if (CategoryName == CollisionCategoryName)
{
CollisionCategory.AddProperty(ChildProperty);
}
}
}
}
}
示例6: CustomizeDetails
void FConfigPropertyHelperDetails::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
TSharedPtr<IPropertyHandle> PropertyHandle = DetailBuilder.GetProperty("EditProperty");
DetailBuilder.HideProperty(PropertyHandle);
UObject* PropValue;
PropertyHandle->GetValue(PropValue);
OriginalProperty = CastChecked<UProperty>(PropValue);
// Create a runtime UClass with the provided property as the only member. We will use this in the details view for the config hierarchy.
ConfigEditorPropertyViewClass = NewObject<UClass>(GetTransientPackage(), TEXT("TempConfigEditorUClass"), RF_Public|RF_Standalone);
// Keep a record of the UProperty we are looking to update
ConfigEditorCopyOfEditProperty = DuplicateObject<UProperty>(OriginalProperty, ConfigEditorPropertyViewClass, PropValue->GetFName());
ConfigEditorPropertyViewClass->ClassConfigName = OriginalProperty->GetOwnerClass()->ClassConfigName;
ConfigEditorPropertyViewClass->SetSuperStruct(UObject::StaticClass());
ConfigEditorPropertyViewClass->ClassFlags |= (CLASS_DefaultConfig | CLASS_Config);
ConfigEditorPropertyViewClass->AddCppProperty(ConfigEditorCopyOfEditProperty);
ConfigEditorPropertyViewClass->Bind();
ConfigEditorPropertyViewClass->StaticLink(true);
ConfigEditorPropertyViewClass->AssembleReferenceTokenStream();
ConfigEditorPropertyViewClass->AddToRoot();
// Cache the CDO for the object
ConfigEditorPropertyViewCDO = ConfigEditorPropertyViewClass->GetDefaultObject(true);
ConfigEditorPropertyViewCDO->AddToRoot();
// Get access to all of the config files where this property is configurable.
ConfigFilesHandle = DetailBuilder.GetProperty("ConfigFilePropertyObjects");
DetailBuilder.HideProperty(ConfigFilesHandle);
// Add the properties to a property table so we can edit these.
IDetailCategoryBuilder& ConfigHierarchyCategory = DetailBuilder.EditCategory("ConfigHierarchy");
ConfigHierarchyCategory.AddCustomRow(LOCTEXT("ConfigHierarchy", "ConfigHierarchy"))
[
// Create a property table with the values.
ConstructPropertyTable(DetailBuilder)
];
// Listen for changes to the properties, we handle these by updating the ini file associated.
FCoreUObjectDelegates::OnObjectPropertyChanged.AddSP(this, &FConfigPropertyHelperDetails::OnPropertyValueChanged);
}
示例7: CustomizeDetails
void FDeviceProfileDetails::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
// Hide all the properties apart from the Console Variables.
IDetailCategoryBuilder& Category = DetailBuilder.EditCategory("DeviceSettings");
TSharedPtr<IPropertyHandle> DeviceTypeHandle = DetailBuilder.GetProperty("DeviceType");
DetailBuilder.HideProperty(DeviceTypeHandle);
TSharedPtr<IPropertyHandle> MeshLODSettingsHandle = DetailBuilder.GetProperty("MeshLODSettings");
DetailBuilder.HideProperty(MeshLODSettingsHandle);
TSharedPtr<IPropertyHandle> TextureLODSettingsHandle = DetailBuilder.GetProperty("TextureLODSettings");
DetailBuilder.HideProperty(TextureLODSettingsHandle);
// Setup the parent profile panel
ParentProfileDetails = MakeShareable(new FDeviceProfileParentPropertyDetails(&DetailBuilder));
ParentProfileDetails->CreateParentPropertyView();
// Setup the console variable editor
ConsoleVariablesDetails = MakeShareable(new FDeviceProfileConsoleVariablesPropertyDetails(&DetailBuilder));
ConsoleVariablesDetails->CreateConsoleVariablesPropertyView();
}
示例8: CustomizeDetails
void FMacGraphicsSwitchingSettingsDetails::CustomizeDetails( IDetailLayoutBuilder& DetailLayout )
{
TSharedRef<IPropertyHandle> PreferredRendererPropertyHandle = DetailLayout.GetProperty("RendererID");
DetailLayout.HideProperty("RendererID");
bool bAllowMultiGPUs = IMacGraphicsSwitchingModule::Get().AllowMultipleGPUs();
bool bAllowAutomaticGraphicsSwitching = IMacGraphicsSwitchingModule::Get().AllowAutomaticGraphicsSwitching();
TSharedRef<IPropertyHandle> MultiGPUPropertyHandle = DetailLayout.GetProperty("bUseMultipleRenderers");
if (!bAllowMultiGPUs)
{
MultiGPUPropertyHandle->SetValue(false);
DetailLayout.HideProperty("bUseMultipleRenderers");
}
TSharedRef<IPropertyHandle> SwitchingPropertyHandle = DetailLayout.GetProperty("bAllowAutomaticGraphicsSwitching");
if (!bAllowAutomaticGraphicsSwitching)
{
SwitchingPropertyHandle->SetValue(false);
DetailLayout.HideProperty("bAllowAutomaticGraphicsSwitching");
}
IDetailCategoryBuilder& AccessorCategory = DetailLayout.EditCategory( "OpenGL" );
AccessorCategory.AddCustomRow( LOCTEXT("PreferredRenderer", "Preferred Renderer").ToString() )
.NameContent()
[
PreferredRendererPropertyHandle->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(113)
.MaxDesiredWidth(113)
[
SNew(SMacGraphicsSwitchingWidget)
.bLiveSwitching(false)
.PreferredRendererPropertyHandle(PreferredRendererPropertyHandle)
];
}
示例9: CustomizeDetails
void FSourceCodeAccessSettingsDetails::CustomizeDetails( IDetailLayoutBuilder& DetailLayout )
{
TSharedRef<IPropertyHandle> PreferredProviderPropertyHandle = DetailLayout.GetProperty("PreferredAccessor");
DetailLayout.HideProperty("PreferredAccessor");
// regenerate accessors list
Accessors.Empty();
const int32 FeatureCount = IModularFeatures::Get().GetModularFeatureImplementationCount("SourceCodeAccessor");
for(int32 FeatureIndex = 0; FeatureIndex < FeatureCount; FeatureIndex++)
{
IModularFeature* Feature = IModularFeatures::Get().GetModularFeatureImplementation("SourceCodeAccessor", FeatureIndex);
check(Feature);
ISourceCodeAccessor& Accessor = *static_cast<ISourceCodeAccessor*>(Feature);
if(Accessor.GetFName() != FName("None"))
{
Accessors.Add(MakeShareable(new FAccessorItem(Accessor.GetNameText(), Accessor.GetFName())));
}
}
IDetailCategoryBuilder& AccessorCategory = DetailLayout.EditCategory( "Accessor" );
AccessorCategory.AddCustomRow( LOCTEXT("PreferredAccessor", "Preferred Accessor").ToString() )
.NameContent()
[
PreferredProviderPropertyHandle->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(113)
.MaxDesiredWidth(113)
[
SNew(SComboBox< TSharedPtr<FAccessorItem>>)
.ToolTipText(LOCTEXT("PreferredAccessorToolTip", "Choose the way to access source code."))
.OptionsSource(&Accessors)
.OnSelectionChanged(this, &FSourceCodeAccessSettingsDetails::OnSelectionChanged, PreferredProviderPropertyHandle)
.ContentPadding(2)
.OnGenerateWidget(this, &FSourceCodeAccessSettingsDetails::OnGenerateWidget)
.Content()
[
SNew(STextBlock)
.Text(this, &FSourceCodeAccessSettingsDetails::GetAccessorText)
.Font( IDetailLayoutBuilder::GetDetailFont() )
]
];
}
示例10: CustomizeDetails
void FTransitionPoseEvaluatorNodeDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder )
{
const TArray< TWeakObjectPtr<UObject> >& SelectedObjects = DetailBuilder.GetDetailsView().GetSelectedObjects();
for (int32 ObjectIndex = 0; (EvaluatorNode == NULL) && (ObjectIndex < SelectedObjects.Num()); ++ObjectIndex)
{
const TWeakObjectPtr<UObject>& CurrentObject = SelectedObjects[ObjectIndex];
if (CurrentObject.IsValid())
{
EvaluatorNode = Cast<UAnimGraphNode_TransitionPoseEvaluator>(CurrentObject.Get());
}
}
IDetailCategoryBuilder& PoseCategory = DetailBuilder.EditCategory("Pose", LOCTEXT("PoseCategoryName", "Pose") );
TSharedPtr<IPropertyHandle> FramesToCachePosePropety = DetailBuilder.GetProperty(TEXT("Node.FramesToCachePose"));
//@TODO: CONDUIT: try both
DetailBuilder.HideProperty(FramesToCachePosePropety);
PoseCategory.AddProperty( FramesToCachePosePropety ).Visibility( TAttribute<EVisibility>( this, &FTransitionPoseEvaluatorNodeDetails::GetFramesToCachePoseVisibility ) );
}
示例11: CustomizeDetails
void FTODAssetDetails::CustomizeDetails(IDetailLayoutBuilder& DetailLayout)
{
const IDetailsView& DetailView = DetailLayout.GetDetailsView();
TWeakObjectPtr<UObject> InspectedObject;
for (TWeakObjectPtr<UObject> inspObj : DetailView.GetSelectedObjects())
{
InspectedObject = inspObj;
break;
}
UTODAsset* TODAsset = Cast<UTODAsset>(InspectedObject.Get());
if (TODAsset)
{
for (TFieldIterator<UProperty> PropIt(TODAsset->GetClass()); PropIt; ++PropIt)
{
UProperty* prop = *PropIt;
DetailLayout.HideProperty(prop->GetFName());
}
}
FName CurrentPropertyName = TEXT("SunIntensityCurve");// NAME_None;
//if (OnGetCurrentProperty.IsBound())
//{
// CurrentPropertyName = OnGetCurrentProperty.Execute();
//}
if (CurrentPropertyName != NAME_None)
{
TSharedPtr<IPropertyHandle> PropHandle = DetailLayout.GetProperty(CurrentPropertyName);
check(PropHandle.IsValid());
IDetailCategoryBuilder& DetailCategoryBuilder = DetailLayout.EditCategory("Property Detail");
DetailCategoryBuilder.AddProperty(PropHandle);
}
}
示例12: CustomizeDetails
void FTileSetDetailsCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailLayout)
{
MyDetailLayout = &DetailLayout;
for (const TWeakObjectPtr<UObject> SelectedObject : DetailLayout.GetSelectedObjects())
{
if (UPaperTileSet* TileSet = Cast<UPaperTileSet>(SelectedObject.Get()))
{
TileSetPtr = TileSet;
break;
}
}
IDetailCategoryBuilder& TileSetCategory = DetailLayout.EditCategory("TileSet", FText::GetEmpty());
// Add the width and height in cells of this tile set to the header
TileSetCategory.HeaderContent
(
SNew(SBox)
.HAlign(HAlign_Right)
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.Padding(FMargin(5.0f, 0.0f))
.AutoWidth()
[
SNew(STextBlock)
.Font(FEditorStyle::GetFontStyle("TinyText"))
.Text(this, &FTileSetDetailsCustomization::GetCellDimensionHeaderText)
.ColorAndOpacity(this, &FTileSetDetailsCustomization::GetCellDimensionHeaderColor)
.ToolTipText(LOCTEXT("NumCellsTooltip", "Number of tile cells in this tile set"))
]
]
);
if (bIsEmbeddedInTileSetEditor)
{
// Hide the array to start with
const FName MetadataArrayName = UPaperTileSet::GetPerTilePropertyName();
TSharedPtr<IPropertyHandle> PerTileArrayProperty = DetailLayout.GetProperty(MetadataArrayName);
DetailLayout.HideProperty(PerTileArrayProperty);
// this array is potentially huge and has a costly validation overhead. We only ever show one element in the array so there is no need to validate every element.
PerTileArrayProperty->SetIgnoreValidation(true);
if (SelectedSingleTileIndex != INDEX_NONE)
{
// Customize for the single tile being edited
IDetailCategoryBuilder& SingleTileCategory = DetailLayout.EditCategory("SingleTileEditor", FText::GetEmpty());
uint32 NumChildren;
if ((PerTileArrayProperty->GetNumChildren(/*out*/ NumChildren) == FPropertyAccess::Success) && ((uint32)SelectedSingleTileIndex < NumChildren))
{
TSharedPtr<IPropertyHandle> OneTileEntry = PerTileArrayProperty->GetChildHandle(SelectedSingleTileIndex);
SingleTileCategory.AddProperty(OneTileEntry)
.ShouldAutoExpand(true);
}
// Add a display of the tile index being edited to the header
const FText TileIndexHeaderText = FText::Format(LOCTEXT("SingleTileSectionHeader", "Editing Tile #{0}"), FText::AsNumber(SelectedSingleTileIndex));
SingleTileCategory.HeaderContent
(
SNew(SBox)
.HAlign(HAlign_Right)
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.Padding(FMargin(5.0f, 0.0f))
.AutoWidth()
[
SNew(STextBlock)
.Font(FEditorStyle::GetFontStyle("TinyText"))
.Text(TileIndexHeaderText)
]
]
);
}
}
}
示例13: CustomizeDetails
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void FLandscapeEditorDetailCustomization_CopyPaste::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
if (!IsToolActive("ToolSet_CopyPaste"))
{
return;
}
IDetailCategoryBuilder& ToolsCategory = DetailBuilder.EditCategory("Tool Settings");
ToolsCategory.AddCustomRow("Copy Data to Gizmo")
[
SNew(SButton)
.ToolTipText(LOCTEXT("CopyToGizmo.Tooltip", "Copies the data within the gizmo bounds to the gizmo taking into account any masking from selected regions."))
.Text(LOCTEXT("CopyToGizmo", "Copy Data to Gizmo"))
.HAlign(HAlign_Center)
.OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnCopyToGizmoButtonClicked)
];
ToolsCategory.AddCustomRow("Fit Gizmo to Selected Regions")
[
SNew(SButton)
.ToolTipText(LOCTEXT("FitGizmoToSelection.Tooltip", "Positions and resizes the gizmo so that it completely encompasses all region selections."))
.Text(LOCTEXT("FitGizmoToSelection", "Fit Gizmo to Selected Regions"))
.HAlign(HAlign_Center)
.OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnFitGizmoToSelectionButtonClicked)
];
ToolsCategory.AddCustomRow("Fit Height Values to Gizmo Size")
[
SNew(SButton)
.ToolTipText(LOCTEXT("FitHeightsToGizmo.Tooltip", "Scales the data in the gizmo to fit the gizmo's Z size"))
.Text(LOCTEXT("FitHeightsToGizmo", "Fit Height Values to Gizmo Size"))
.HAlign(HAlign_Center)
.OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnFitHeightsToGizmoButtonClicked)
];
ToolsCategory.AddCustomRow("Clear Gizmo Data")
[
SNew(SButton)
.ToolTipText(LOCTEXT("ClearGizmoData.Tooltip", "Clears the gizmo of any copied data."))
.Text(LOCTEXT("ClearGizmoData", "Clear Gizmo Data"))
.HAlign(HAlign_Center)
.OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnClearGizmoDataButtonClicked)
];
IDetailGroup& GizmoImportExportGroup = ToolsCategory.AddGroup("Gizmo Import / Export", LOCTEXT("ImportExportTitle", "Gizmo Import / Export").ToString(), true);
TSharedRef<IPropertyHandle> PropertyHandle_Heightmap = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, GizmoHeightmapFilenameString));
DetailBuilder.HideProperty(PropertyHandle_Heightmap);
GizmoImportExportGroup.AddPropertyRow(PropertyHandle_Heightmap)
.CustomWidget()
.NameContent()
[
PropertyHandle_Heightmap->CreatePropertyNameWidget()
]
.ValueContent()
.MinDesiredWidth(250.0f)
.MaxDesiredWidth(0)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
[
PropertyHandle_Heightmap->CreatePropertyValueWidget()
]
+ SHorizontalBox::Slot()
.AutoWidth()
//.Padding(0,0,12,0) // Line up with the other properties due to having no reset to default button
[
SNew(SButton)
.ContentPadding(FMargin(4, 0))
.Text(NSLOCTEXT("UnrealEd", "GenericOpenDialog", "..."))
.OnClicked_Static(&FLandscapeEditorDetailCustomization_CopyPaste::OnGizmoHeightmapFilenameButtonClicked, PropertyHandle_Heightmap)
]
];
TSharedRef<IPropertyHandle> PropertyHandle_ImportSize = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(ULandscapeEditorObject, GizmoImportSize));
TSharedRef<IPropertyHandle> PropertyHandle_ImportSize_X = PropertyHandle_ImportSize->GetChildHandle("X").ToSharedRef();
TSharedRef<IPropertyHandle> PropertyHandle_ImportSize_Y = PropertyHandle_ImportSize->GetChildHandle("Y").ToSharedRef();
DetailBuilder.HideProperty(PropertyHandle_ImportSize);
GizmoImportExportGroup.AddPropertyRow(PropertyHandle_ImportSize)
.CustomWidget()
.NameContent()
[
PropertyHandle_ImportSize->CreatePropertyNameWidget()
]
.ValueContent()
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.FillWidth(1)
[
SNew(SNumericEntryBox<int32>)
.LabelVAlign(VAlign_Center)
.Font(DetailBuilder.GetDetailFont())
.MinValue(1)
.MaxValue(8192)
.MinSliderValue(1)
.MaxSliderValue(8192)
//.........这里部分代码省略.........
示例14: CustomizeDetails
void FActorDetails::CustomizeDetails( IDetailLayoutBuilder& DetailLayout )
{
// These details only apply when adding an instance of the actor in a level
if( !DetailLayout.GetDetailsView().HasClassDefaultObject() && DetailLayout.GetDetailsView().GetSelectedActorInfo().NumSelected > 0 )
{
// Build up a list of unique blueprints in the selection set (recording the first actor in the set for each one)
TMap<UBlueprint*, UObject*> UniqueBlueprints;
// Per level Actor Counts
TMap<ULevel*, int32> ActorsPerLevelCount;
bool bHasBillboardComponent = false;
const TArray< TWeakObjectPtr<UObject> >& SelectedObjects = DetailLayout.GetDetailsView().GetSelectedObjects();
for (int32 ObjectIndex = 0; ObjectIndex < SelectedObjects.Num(); ++ObjectIndex)
{
AActor* Actor = Cast<AActor>( SelectedObjects[ObjectIndex].Get() );
if (Actor != NULL)
{
// Store the selected actors for use later. Its fine to do this when CustomizeDetails is called because if the selected actors changes, CustomizeDetails will be called again on a new instance
// and our current resource would be destroyed.
SelectedActors.Add( Actor );
// Record the level that contains this actor and increment it's actor count
ULevel* Level = Actor->GetTypedOuter<ULevel>();
if (Level != NULL)
{
int32& ActorCountForThisLevel = ActorsPerLevelCount.FindOrAdd(Level);
++ActorCountForThisLevel;
}
// Add to the unique blueprint map if the actor is generated from a blueprint
if (UBlueprint* Blueprint = Cast<UBlueprint>(Actor->GetClass()->ClassGeneratedBy))
{
if (!UniqueBlueprints.Find(Blueprint))
{
UniqueBlueprints.Add(Blueprint, Actor);
}
}
if (!bHasBillboardComponent)
{
bHasBillboardComponent = Actor->FindComponentByClass<UBillboardComponent>() != NULL;
}
}
}
if (!bHasBillboardComponent)
{
// Actor billboard scale is not relevant if the actor doesn't have a billboard component
DetailLayout.HideProperty( GET_MEMBER_NAME_CHECKED(AActor, SpriteScale) );
}
AddTransformCategory( DetailLayout );
AddMaterialCategory( DetailLayout );
AddActorCategory( DetailLayout, ActorsPerLevelCount );
// Get the list of hidden categories
TArray<FString> HideCategories;
DetailLayout.GetDetailsView().GetBaseClass()->GetHideCategories(HideCategories);
// Add Blueprint category, if not being hidden
if (!HideCategories.Contains(TEXT("Blueprint")))
{
AddBlueprintCategory(DetailLayout, UniqueBlueprints);
}
if( GetDefault<UEditorExperimentalSettings>()->bCodeView )
{
AddCodeViewCategory( DetailLayout );
}
if (!HideCategories.Contains(TEXT("Layers")))
{
AddLayersCategory(DetailLayout);
}
//AddComponentsCategory( DetailLayout );
}
}
示例15: BuildCollisionSection
void FSpriteDetailsCustomization::BuildCollisionSection(IDetailCategoryBuilder& CollisionCategory, IDetailLayoutBuilder& DetailLayout)
{
TSharedPtr<IPropertyHandle> SpriteCollisionDomainProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UPaperSprite, SpriteCollisionDomain));
TAttribute<EVisibility> ParticipatesInPhysics = TAttribute<EVisibility>::Create( TAttribute<EVisibility>::FGetter::CreateSP( this, &FSpriteDetailsCustomization::AnyPhysicsMode, SpriteCollisionDomainProperty) ) ;
TAttribute<EVisibility> ParticipatesInPhysics3D = TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FSpriteDetailsCustomization::PhysicsModeMatches, SpriteCollisionDomainProperty, ESpriteCollisionMode::Use3DPhysics));
TAttribute<EVisibility> ParticipatesInPhysics2D = TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FSpriteDetailsCustomization::PhysicsModeMatches, SpriteCollisionDomainProperty, ESpriteCollisionMode::Use2DPhysics));
CollisionCategory.AddProperty(SpriteCollisionDomainProperty);
// Add a warning bar about 2D collision being experimental
FText WarningFor2D = LOCTEXT("Experimental2DPhysicsWarning", "2D collision support is *experimental*");
FText TooltipFor2D = LOCTEXT("Experimental2DPhysicsWarningTooltip", "2D collision support is *experimental* and should not be relied on yet.\n\nRigid body collision detection and response works, but there are only precompiled libraries for Windows currently.\n\nRaycasts are partially supported (and need to be enabled in project settings), but queries, sweeps, or overlap tests are not implemented yet.");
GenerateWarningRow(CollisionCategory, /*bExperimental=*/ true, WarningFor2D, TooltipFor2D, TEXT("Shared/Editors/SpriteEditor"), TEXT("CollisionDomain2DWarning"))
.Visibility(ParticipatesInPhysics2D);
// Add a warning bar if 2D collision queries aren't enabled
TAttribute<EVisibility> WarnAbout2DQueriesBeingDisabledVisibility = TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FSpriteDetailsCustomization::Get2DPhysicsNotEnabledWarningVisibility, SpriteCollisionDomainProperty));
FText QueryWarningFor2D = LOCTEXT("Query2DPhysicsWarning", "2D collision queries are disabled");
FText QueryTooltipFor2D = LOCTEXT("Query2DPhysicsWarningTooltip", "You can enable 2D queries in Project Settings..Physics by setting bEnable2DPhysics to true, otherwise only collision detection and response will work.\n\nNote: Only raycasts are partially supported; other queries, sweeps, and overlap tests are not implemented yet.");
GenerateWarningRow(CollisionCategory, /*bExperimental=*/ false, QueryWarningFor2D, QueryTooltipFor2D, TEXT("Shared/Editors/SpriteEditor"), TEXT("Disabled2DCollisionQueriesWarning"))
.Visibility(WarnAbout2DQueriesBeingDisabledVisibility);
// Add the collision geometry mode into the parent container (renamed)
{
// Restrict the diced value
TSharedPtr<FPropertyRestriction> PreventDicedRestriction = MakeShareable(new FPropertyRestriction(LOCTEXT("CollisionGeometryDoesNotSupportDiced", "Collision geometry can not be set to Diced")));
PreventDicedRestriction->AddValue(TEXT("Diced"));
// Find and add the property
const FString CollisionGeometryTypePropertyPath = FString::Printf(TEXT("%s.%s"), GET_MEMBER_NAME_STRING_CHECKED(UPaperSprite, CollisionGeometry), GET_MEMBER_NAME_STRING_CHECKED(FSpritePolygonCollection, GeometryType));
TSharedPtr<IPropertyHandle> CollisionGeometryTypeProperty = DetailLayout.GetProperty(*CollisionGeometryTypePropertyPath);
CollisionGeometryTypeProperty->AddRestriction(PreventDicedRestriction.ToSharedRef());
CollisionCategory.AddProperty(CollisionGeometryTypeProperty)
.DisplayName(LOCTEXT("CollisionGeometryType", "Collision Geometry Type"))
.Visibility(ParticipatesInPhysics);
}
// Show the collision geometry when not None
CollisionCategory.AddProperty( DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UPaperSprite, CollisionGeometry)) )
.Visibility(ParticipatesInPhysics);
// Show the collision thickness only in 3D mode
CollisionCategory.AddProperty( DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UPaperSprite, CollisionThickness)) )
.Visibility(ParticipatesInPhysics3D);
// Add the collision polygons into advanced (renamed)
const FString CollisionGeometryPolygonsPropertyPath = FString::Printf(TEXT("%s.%s"), GET_MEMBER_NAME_STRING_CHECKED(UPaperSprite, CollisionGeometry), GET_MEMBER_NAME_STRING_CHECKED(FSpritePolygonCollection, Polygons));
CollisionCategory.AddProperty(DetailLayout.GetProperty(*CollisionGeometryPolygonsPropertyPath), EPropertyLocation::Advanced)
.DisplayName(LOCTEXT("CollisionPolygons", "Collision Polygons"))
.Visibility(ParticipatesInPhysics);
// Show the default body instance (and only it) from the body setup (if it exists)
DetailLayout.HideProperty("BodySetup");
IDetailPropertyRow& BodySetupDefaultInstance = CollisionCategory.AddProperty("BodySetup.DefaultInstance");
TArray<TWeakObjectPtr<UObject>> SpritesBeingEdited;
DetailLayout.GetObjectsBeingCustomized(/*out*/ SpritesBeingEdited);
TArray<UObject*> BodySetupList;
for (auto WeakSpritePtr : SpritesBeingEdited)
{
if (UPaperSprite* Sprite = Cast<UPaperSprite>(WeakSpritePtr.Get()))
{
if (UBodySetup* BodySetup = Sprite->BodySetup)
{
BodySetupList.Add(BodySetup);
}
}
}
if (BodySetupList.Num() > 0)
{
IDetailPropertyRow* DefaultInstanceRow = CollisionCategory.AddExternalProperty(BodySetupList, GET_MEMBER_NAME_CHECKED(UBodySetup, DefaultInstance));
if (DefaultInstanceRow != nullptr)
{
DefaultInstanceRow->Visibility(ParticipatesInPhysics);
}
}
}