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

45 lines
1.1 KiB
C++
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "CircumferenceMarkerWidget.h"
#include "SCircumferenceMarkerWidget.h"
UCircumferenceMarkerWidget::UCircumferenceMarkerWidget(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
Visibility = ESlateVisibility::HitTestInvisible;
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);
}
}