Download LyraStarterGame/Source/LyraGame/UI/Weapons/SCircumferenceMarkerWidget.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.87 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Weapons/SCircumferenceMarkerWidget.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/UI/Weapons/SCircumferenceMarkerWidget.h
-
curl -L -o SCircumferenceMarkerWidget.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Weapons/SCircumferenceMarkerWidget.h
2.87 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class FPaintArgs; | |
| class FSlateRect; | |
| class FSlateWindowElementList; | |
| class FWidgetStyle; | |
| struct FGeometry; | |
| struct FSlateBrush; | |
| USTRUCT(BlueprintType) | |
| struct FCircumferenceMarkerEntry | |
| { | |
| GENERATED_BODY() | |
| // The angle to place this marker around the circle (in degrees) | |
| UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(ForceUnits=deg)) | |
| float PositionAngle = 0.0f; | |
| // The angle to rotate the marker image (in degrees) | |
| UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(ForceUnits=deg)) | |
| float ImageRotationAngle = 0.0f; | |
| }; | |
| class SCircumferenceMarkerWidget : public SLeafWidget | |
| { | |
| SLATE_BEGIN_ARGS(SCircumferenceMarkerWidget) | |
| : _MarkerBrush(FCoreStyle::Get().GetBrush("Throbber.CircleChunk")) | |
| , _Radius(48.0f) | |
| { | |
| } | |
| /** What each marker on the circumference looks like */ | |
| SLATE_ARGUMENT(const FSlateBrush*, MarkerBrush) | |
| /** At which angles should a marker be drawn */ | |
| SLATE_ARGUMENT(TArray<FCircumferenceMarkerEntry>, MarkerList) | |
| /** The radius of the circle */ | |
| SLATE_ATTRIBUTE(float, Radius) | |
| /** The color and opacity of the marker */ | |
| SLATE_ATTRIBUTE(FSlateColor, ColorAndOpacity) | |
| SLATE_END_ARGS() | |
| public: | |
| void Construct(const FArguments& InArgs); | |
| SCircumferenceMarkerWidget(); | |
| //~SWidget interface | |
| virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override; | |
| virtual FVector2D ComputeDesiredSize(float) const override; | |
| virtual bool ComputeVolatility() const override { return true; } | |
| //~End of SWidget interface | |
| void SetRadius(float NewRadius); | |
| void SetMarkerList(TArray<FCircumferenceMarkerEntry>& NewMarkerList); | |
| private: | |
| FSlateRenderTransform GetMarkerRenderTransform(const FCircumferenceMarkerEntry& Marker, const float BaseRadius, const float HUDScale) const; | |
| private: | |
| /** What each marker on the circumference looks like */ | |
| const FSlateBrush* MarkerBrush; | |
| /** Angles around the reticle center to place ReticleCornerImage icons */ | |
| TArray<FCircumferenceMarkerEntry> MarkerList; | |
| /** The radius of the circle */ | |
| TAttribute<float> Radius; | |
| /** Color and opacity of the markers */ | |
| TAttribute<FSlateColor> ColorAndOpacity; | |
| bool bColorAndOpacitySet; | |
| /** Whether reticle corner images are placed outside the spread radius */ | |
| //@TODO: Make this a 0-1 float alignment instead (e.g., inside/on/outside the radius)? | |
| uint8 bReticleCornerOutsideSpreadRadius : 1; | |
| }; | |