RealtimeStyleTransferRuntime/Source/LyraGame/UI/Weapons/CircumferenceMarkerWidget.cpp

51 lines
1.2 KiB
C++
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "CircumferenceMarkerWidget.h"
2022-09-13 07:18:28 +00:00
#include "Components/SlateWrapperTypes.h"
#include "Misc/Attribute.h"
#include "UI/Weapons/SCircumferenceMarkerWidget.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
class SWidget;
2022-05-23 18:41:30 +00:00
UCircumferenceMarkerWidget::UCircumferenceMarkerWidget(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
2022-09-13 07:18:28 +00:00
SetVisibility(ESlateVisibility::HitTestInvisible);
2022-05-23 18:41:30 +00:00
bIsVolatile = true;
}
void UCircumferenceMarkerWidget::ReleaseSlateResources(bool bReleaseChildren)
{
Super::ReleaseSlateResources(bReleaseChildren);
MyMarkerWidget.Reset();
}
TSharedRef<SWidget> UCircumferenceMarkerWidget::RebuildWidget()
{
MyMarkerWidget = SNew(SCircumferenceMarkerWidget)
.MarkerBrush(&MarkerImage)
.Radius(this->Radius)
.MarkerList(this->MarkerList);
return MyMarkerWidget.ToSharedRef();
}
void UCircumferenceMarkerWidget::SynchronizeProperties()
{
Super::SynchronizeProperties();
MyMarkerWidget->SetRadius(Radius);
MyMarkerWidget->SetMarkerList(MarkerList);
}
void UCircumferenceMarkerWidget::SetRadius(float InRadius)
{
Radius = InRadius;
if (MyMarkerWidget.IsValid())
{
MyMarkerWidget->SetRadius(InRadius);
}
}