|
|
|
|
| #pragma once
|
|
|
| #include "Engine/LocalPlayer.h"
|
| #include "GameplayTagContainer.h"
|
| #include "Styling/CoreStyle.h"
|
| #include "Styling/SlateBrush.h"
|
| #include "Widgets/DeclarativeSyntaxSupport.h"
|
| #include "Widgets/Accessibility/SlateWidgetAccessibleTypes.h"
|
| #include "Widgets/SLeafWidget.h"
|
|
|
| class FPaintArgs;
|
| class FSlateRect;
|
| class FSlateWindowElementList;
|
| class FWidgetStyle;
|
| struct FGameplayTag;
|
| struct FGeometry;
|
| struct FSlateBrush;
|
|
|
| class SHitMarkerConfirmationWidget : public SLeafWidget
|
| {
|
| SLATE_BEGIN_ARGS(SHitMarkerConfirmationWidget)
|
| : _PerHitMarkerImage(FCoreStyle::Get().GetBrush("Throbber.CircleChunk"))
|
| , _AnyHitsMarkerImage(nullptr)
|
| , _HitNotifyDuration(0.4f)
|
| {
|
| }
|
|
|
| SLATE_ARGUMENT(const FSlateBrush*, PerHitMarkerImage)
|
|
|
| SLATE_ARGUMENT(const FSlateBrush*, AnyHitsMarkerImage)
|
|
|
| SLATE_ATTRIBUTE(float, HitNotifyDuration)
|
|
|
| SLATE_ATTRIBUTE(FSlateColor, ColorAndOpacity)
|
| SLATE_END_ARGS()
|
|
|
| public:
|
| void Construct(const FArguments& InArgs, const FLocalPlayerContext& InContext, const TMap<FGameplayTag, FSlateBrush>& ZoneOverrideImages);
|
|
|
| SHitMarkerConfirmationWidget();
|
|
|
|
|
| virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
|
| virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
|
| virtual FVector2D ComputeDesiredSize(float) const override;
|
| virtual bool ComputeVolatility() const override { return true; }
|
|
|
|
|
| private:
|
|
|
| const FSlateBrush* PerHitMarkerImage = nullptr;
|
|
|
|
|
| TMap<FGameplayTag, FSlateBrush> PerHitMarkerZoneOverrideImages;
|
|
|
|
|
| const FSlateBrush* AnyHitsMarkerImage = nullptr;
|
|
|
|
|
| float HitNotifyOpacity = 0.0f;
|
|
|
|
|
| float HitNotifyDuration = 0.4f;
|
|
|
|
|
| TAttribute<FSlateColor> ColorAndOpacity;
|
| bool bColorAndOpacitySet;
|
|
|
|
|
| FLocalPlayerContext MyContext;
|
| };
|
|
|