You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb graham.wihlidal [FYI] ola.olsson #preflight 61f1a689fc74f46b5645b225 #ROBOMERGE-AUTHOR: andrew.lauritzen #ROBOMERGE-SOURCE: CL 18757572 in //UE5/Release-5.0/... via CL 18759665 via CL 18760682 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472) [CL 18760914 by andrew lauritzen in ue5-main branch]
75 lines
3.1 KiB
C++
75 lines
3.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "DebugCameraControllerSettingsCustomization.h"
|
|
#include "Engine/DebugCameraControllerSettings.h"
|
|
#include "Widgets/Text/STextBlock.h"
|
|
#include "PropertyRestriction.h"
|
|
#include "IDetailChildrenBuilder.h"
|
|
#include "DetailLayoutBuilder.h"
|
|
#include "DetailCategoryBuilder.h"
|
|
#include "DetailWidgetRow.h"
|
|
#include "IDetailPropertyRow.h"
|
|
#include "ShowFlags.h"
|
|
#include "RHI.h"
|
|
|
|
|
|
TSharedRef<IPropertyTypeCustomization> FDebugCameraControllerSettingsViewModeIndexCustomization::MakeInstance()
|
|
{
|
|
return MakeShareable( new FDebugCameraControllerSettingsViewModeIndexCustomization);
|
|
}
|
|
|
|
FDebugCameraControllerSettingsViewModeIndexCustomization::FDebugCameraControllerSettingsViewModeIndexCustomization()
|
|
{
|
|
}
|
|
|
|
void FDebugCameraControllerSettingsViewModeIndexCustomization::CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
|
|
{
|
|
uint32 NumChildren;
|
|
StructPropertyHandle->GetNumChildren(NumChildren);
|
|
TSharedPtr<IPropertyHandle> ViewModeIndexHandle;
|
|
|
|
for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ++ChildIndex)
|
|
{
|
|
const TSharedRef< IPropertyHandle > ChildHandle = StructPropertyHandle->GetChildHandle(ChildIndex).ToSharedRef();
|
|
|
|
if (ChildHandle->GetProperty()->GetName() == TEXT("ViewModeIndex"))
|
|
{
|
|
ViewModeIndexHandle = ChildHandle;
|
|
}
|
|
}
|
|
|
|
check(ViewModeIndexHandle.IsValid());
|
|
|
|
TSharedPtr<FPropertyRestriction> EnumRestriction = MakeShareable(new FPropertyRestriction(NSLOCTEXT("DebugCycleViewModes", "DebugCycleViewModes", "Cycle view modes for debug camera controller")));
|
|
const UEnum* const ViewModeIndexEnum = StaticEnum<EViewModeIndex>();
|
|
EnumRestriction->AddHiddenValue(ViewModeIndexEnum->GetNameStringByValue((uint8)EViewModeIndex::VMI_VisualizeBuffer));
|
|
EnumRestriction->AddHiddenValue(ViewModeIndexEnum->GetNameStringByValue((uint8)EViewModeIndex::VMI_VisualizeNanite));
|
|
EnumRestriction->AddHiddenValue(ViewModeIndexEnum->GetNameStringByValue((uint8)EViewModeIndex::VMI_VisualizeLumen));
|
|
EnumRestriction->AddHiddenValue(ViewModeIndexEnum->GetNameStringByValue((uint8)EViewModeIndex::VMI_VisualizeVirtualShadowMap));
|
|
EnumRestriction->AddHiddenValue(ViewModeIndexEnum->GetNameStringByValue((uint8)EViewModeIndex::VMI_StationaryLightOverlap));
|
|
#if RHI_RAYTRACING
|
|
if (!GRHISupportsRayTracing || !GRHISupportsRayTracingShaders)
|
|
{
|
|
EnumRestriction->AddHiddenValue(ViewModeIndexEnum->GetNameStringByValue((uint8)EViewModeIndex::VMI_PathTracing));
|
|
EnumRestriction->AddHiddenValue(ViewModeIndexEnum->GetNameStringByValue((uint8)EViewModeIndex::VMI_RayTracingDebug));
|
|
}
|
|
#endif
|
|
ViewModeIndexHandle->AddRestriction(EnumRestriction.ToSharedRef());
|
|
|
|
HeaderRow
|
|
.NameContent()
|
|
[
|
|
StructPropertyHandle->CreatePropertyNameWidget()
|
|
]
|
|
.ValueContent()
|
|
.MinDesiredWidth(500)
|
|
[
|
|
ViewModeIndexHandle->CreatePropertyValueWidget()
|
|
];
|
|
}
|
|
|
|
void FDebugCameraControllerSettingsViewModeIndexCustomization::CustomizeChildren(TSharedRef<IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
|
|
{
|
|
}
|
|
|