RealtimeStyleTransferRuntime/Source/LyraGame/UI/Weapons/HitMarkerConfirmationWidget...

43 lines
1.4 KiB
C++
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "HitMarkerConfirmationWidget.h"
2022-09-13 07:18:28 +00:00
2022-05-23 18:41:30 +00:00
#include "Blueprint/UserWidget.h"
2022-09-13 07:18:28 +00:00
#include "Components/SlateWrapperTypes.h"
#include "Containers/EnumAsByte.h"
#include "Engine/LocalPlayer.h"
#include "Misc/Attribute.h"
#include "SHitMarkerConfirmationWidget.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
class SWidget;
2022-05-23 18:41:30 +00:00
UHitMarkerConfirmationWidget::UHitMarkerConfirmationWidget(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;
AnyHitsMarkerImage.DrawAs = ESlateBrushDrawType::NoDrawType;
}
void UHitMarkerConfirmationWidget::ReleaseSlateResources(bool bReleaseChildren)
{
Super::ReleaseSlateResources(bReleaseChildren);
MyMarkerWidget.Reset();
}
TSharedRef<SWidget> UHitMarkerConfirmationWidget::RebuildWidget()
{
UUserWidget* OuterUserWidget = GetTypedOuter<UUserWidget>();
FLocalPlayerContext DummyContext;
const FLocalPlayerContext& PlayerContextRef = (OuterUserWidget != nullptr) ? OuterUserWidget->GetPlayerContext() : DummyContext;
MyMarkerWidget = SNew(SHitMarkerConfirmationWidget, PlayerContextRef, PerHitMarkerZoneOverrideImages)
.PerHitMarkerImage(&(this->PerHitMarkerImage))
.AnyHitsMarkerImage(&(this->AnyHitsMarkerImage))
.HitNotifyDuration(this->HitNotifyDuration);
return MyMarkerWidget.ToSharedRef();
}