You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb none #ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904 #ROBOMERGE-BOT: (v613-10869866) [CL 10870586 by ryan durand in Main branch]
48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "NavLinkStructCustomization.h"
|
|
#include "Widgets/Text/STextBlock.h"
|
|
#include "IDetailChildrenBuilder.h"
|
|
#include "DetailWidgetRow.h"
|
|
#include "AI/Navigation/NavLinkDefinition.h"
|
|
|
|
TSharedRef<IPropertyTypeCustomization> FNavLinkStructCustomization::MakeInstance( )
|
|
{
|
|
return MakeShareable(new FNavLinkStructCustomization);
|
|
}
|
|
|
|
void FNavLinkStructCustomization::CustomizeHeader( TSharedRef<IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils )
|
|
{
|
|
TSharedPtr<IPropertyHandle> CommentHandle = StructPropertyHandle->GetChildHandle(GET_MEMBER_NAME_CHECKED(FNavigationLinkBase,Description));
|
|
FString Desc;
|
|
|
|
if (CommentHandle.IsValid())
|
|
{
|
|
CommentHandle->GetValue(Desc);
|
|
}
|
|
|
|
HeaderRow.NameContent()
|
|
[
|
|
StructPropertyHandle->CreatePropertyNameWidget()
|
|
]
|
|
.ValueContent()
|
|
.MaxDesiredWidth(400.0f)
|
|
[
|
|
SNew(STextBlock)
|
|
.Text(FText::FromString(Desc))
|
|
.Font(StructCustomizationUtils.GetRegularFont())
|
|
];
|
|
}
|
|
|
|
void FNavLinkStructCustomization::CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils)
|
|
{
|
|
uint32 NumChildProps = 0;
|
|
StructPropertyHandle->GetNumChildren(NumChildProps);
|
|
|
|
for (uint32 Idx = 0; Idx < NumChildProps; Idx++)
|
|
{
|
|
TSharedPtr<IPropertyHandle> PropHandle = StructPropertyHandle->GetChildHandle(Idx);
|
|
StructBuilder.AddProperty(PropHandle.ToSharedRef());
|
|
}
|
|
}
|