Files
bryan johnson e7bdda6b95 [Backout] - CL35087217
[FYI] Bryan.Johnson
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL35079176
[FYI] Mieszko.Zielinski
Original CL Desc
-----------------------------------------------------------------
Moved the rest of MassEntity modules over to the Engine's Source/ code.

#jira UE-216267

[CL 35087666 by bryan johnson in ue5-main branch]
2024-07-25 13:36:25 -04:00

95 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "SMassProcessor.h"
#include "MassDebuggerModel.h"
#include "MassDebuggerStyle.h"
#include "SMassQuery.h"
#include "Widgets/Text/SRichTextBlock.h"
#include "Widgets/Text/STextBlock.h"
#include "Widgets/SBoxPanel.h"
#include "Widgets/Layout/SBorder.h"
#include "Styling/AppStyle.h"
#define LOCTEXT_NAMESPACE "SMassDebugger"
//----------------------------------------------------------------------//
// SMassProcessor
//----------------------------------------------------------------------//
void SMassProcessor::Construct(const FArguments& InArgs, TSharedPtr<FMassDebuggerProcessorData> InProcessorData)
{
ProcessorData = InProcessorData;
if (!ProcessorData)
{
return;
}
TSharedRef<SVerticalBox> Box = SNew(SVerticalBox);
Box->AddSlot()
.AutoHeight()
[
SNew(SBorder)
.Padding(FMargin(10, 5))
[
SNew(SRichTextBlock)
.Text(FText::FromString(ProcessorData->Label))
.DecoratorStyleSet(&FAppStyle::Get())
.TextStyle(FAppStyle::Get(), "LargeText")
]
];
#if WITH_MASSENTITY_DEBUG
if (!ProcessorData->Description.IsEmpty())
{
Box->AddSlot()
.AutoHeight()
[
SNew(SBorder)
.Padding(10.0f)
[
SNew(STextBlock)
.Text(FText::FromString(ProcessorData->Description))
]
];
}
#endif //WITH_MASSENTITY_DEBUG
if (ProcessorData->ProcessorRequirements->IsEmpty())
{
Box->AddSlot()
.AutoHeight()
[
SNew(SBorder)
.Padding(10.0f)
[
SNew(STextBlock)
.Text(LOCTEXT("NoProcessorRequirements", "No Processor Requirements"))
]
];
}
else
{
Box->AddSlot()
.AutoHeight()
[
SNew(SMassQuery, ProcessorData->ProcessorRequirements)
];
}
for (TSharedPtr<FMassDebuggerQueryData>& QueryData : ProcessorData->Queries)
{
Box->AddSlot()
.AutoHeight()
[
SNew(SMassQuery, QueryData)
];
}
ChildSlot
[
Box
];
}
#undef LOCTEXT_NAMESPACE