You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 6272a74d2f6d177be3c6fdda #rb Matt.Kuhlenschmidt #ROBOMERGE-OWNER: Lauren.Barnes #ROBOMERGE-AUTHOR: lauren.barnes #ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690) #ROBOMERGE-CONFLICT from-shelf [CL 20105363 by Lauren Barnes in ue5-main branch]
79 lines
2.8 KiB
C++
79 lines
2.8 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ActorComponentDetails.h"
|
|
#include "Layout/Visibility.h"
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
#include "Widgets/SBoxPanel.h"
|
|
#include "Widgets/Layout/SBorder.h"
|
|
#include "Widgets/Images/SImage.h"
|
|
#include "Widgets/Text/STextBlock.h"
|
|
#include "Styling/AppStyle.h"
|
|
#include "Engine/EngineBaseTypes.h"
|
|
#include "Components/ActorComponent.h"
|
|
#include "DetailLayoutBuilder.h"
|
|
#include "DetailWidgetRow.h"
|
|
#include "DetailCategoryBuilder.h"
|
|
#include "IDetailsView.h"
|
|
#include "ObjectEditorUtils.h"
|
|
#include "Widgets/SToolTip.h"
|
|
#include "IDocumentation.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "ActorComponentDetails"
|
|
|
|
TSharedRef<IDetailCustomization> FActorComponentDetails::MakeInstance()
|
|
{
|
|
return MakeShareable( new FActorComponentDetails );
|
|
}
|
|
|
|
void FActorComponentDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder )
|
|
{
|
|
TSharedPtr<IPropertyHandle> PrimaryTickProperty = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(UActorComponent, PrimaryComponentTick));
|
|
|
|
// Defaults only show tick properties
|
|
if (PrimaryTickProperty->IsValidHandle() && DetailBuilder.HasClassDefaultObject())
|
|
{
|
|
IDetailCategoryBuilder& TickCategory = DetailBuilder.EditCategory("ComponentTick");
|
|
|
|
TickCategory.AddProperty(PrimaryTickProperty->GetChildHandle(GET_MEMBER_NAME_CHECKED(FTickFunction, bStartWithTickEnabled)));
|
|
TickCategory.AddProperty(PrimaryTickProperty->GetChildHandle(GET_MEMBER_NAME_CHECKED(FTickFunction, TickInterval)));
|
|
TickCategory.AddProperty(PrimaryTickProperty->GetChildHandle(GET_MEMBER_NAME_CHECKED(FTickFunction, bTickEvenWhenPaused)), EPropertyLocation::Advanced);
|
|
TickCategory.AddProperty(PrimaryTickProperty->GetChildHandle(GET_MEMBER_NAME_CHECKED(FTickFunction, bAllowTickOnDedicatedServer)), EPropertyLocation::Advanced);
|
|
TickCategory.AddProperty(PrimaryTickProperty->GetChildHandle(GET_MEMBER_NAME_CHECKED(FTickFunction, TickGroup)), EPropertyLocation::Advanced);
|
|
}
|
|
|
|
PrimaryTickProperty->MarkHiddenByCustomization();
|
|
|
|
TArray<TWeakObjectPtr<UObject>> WeakObjectsBeingCustomized;
|
|
DetailBuilder.GetObjectsBeingCustomized(WeakObjectsBeingCustomized);
|
|
|
|
bool bHideReplicates = false;
|
|
for (TWeakObjectPtr<UObject>& WeakObjectBeingCustomized : WeakObjectsBeingCustomized)
|
|
{
|
|
if (UObject* ObjectBeingCustomized = WeakObjectBeingCustomized.Get())
|
|
{
|
|
if (UActorComponent* Component = Cast<UActorComponent>(ObjectBeingCustomized))
|
|
{
|
|
if (!Component->GetComponentClassCanReplicate())
|
|
{
|
|
bHideReplicates = true;
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
bHideReplicates = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (bHideReplicates)
|
|
{
|
|
TSharedPtr<IPropertyHandle> ReplicatesProperty = DetailBuilder.GetProperty(UActorComponent::GetReplicatesPropertyName());
|
|
ReplicatesProperty->MarkHiddenByCustomization();
|
|
}
|
|
}
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|