blaster/Source/Blaster/HUD/BlasterHUD.h

63 lines
1.3 KiB
C
Raw Normal View History

2022-05-05 15:57:57 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/HUD.h"
#include "BlasterHUD.generated.h"
USTRUCT(BlueprintType)
struct FHUDPackage
{
GENERATED_BODY()
public:
UTexture2D* CrosshairsCenter;
UTexture2D* CrosshairsLeft;
UTexture2D* CrosshairsRight;
UTexture2D* CrosshairsTop;
UTexture2D* CrosshairsBottom;
2022-05-05 16:48:17 +00:00
float CrosshairSpread;
2022-05-10 20:34:28 +00:00
FLinearColor CrosshairsColor;
2022-05-05 15:57:57 +00:00
};
/**
*
*/
UCLASS()
class BLASTER_API ABlasterHUD : public AHUD
{
GENERATED_BODY()
public:
virtual void DrawHUD() override;
2022-05-10 10:42:09 +00:00
void AddCharacterOverlay();
2022-05-10 20:34:28 +00:00
void AddAnnouncement();
2022-05-10 10:42:09 +00:00
2022-05-07 09:04:11 +00:00
UPROPERTY(EditAnywhere, Category = "Player Stats")
TSubclassOf<class UUserWidget> CharacterOverlayClass;
2022-05-09 15:16:41 +00:00
UPROPERTY()
2022-05-07 09:04:11 +00:00
class UCharacterOverlay* CharacterOverlay;
2022-05-10 11:31:39 +00:00
UPROPERTY(EditAnywhere, Category = "Announcements")
TSubclassOf<class UUserWidget> AnnouncementClass;
UPROPERTY()
class UAnnouncement* Announcement;
2022-05-07 09:04:11 +00:00
protected:
virtual void BeginPlay() override;
2022-05-05 15:57:57 +00:00
private:
FHUDPackage HUDPackage;
2022-05-05 20:46:35 +00:00
void DrawCrosshair(UTexture2D* Texture, FVector2D ViewportCenter, FVector2D Spread, FLinearColor CrosshairColor);
2022-05-05 16:48:17 +00:00
UPROPERTY(EditAnywhere)
float CrosshairSpreadMax = 16.f;
2022-05-05 16:16:59 +00:00
2022-05-05 15:57:57 +00:00
public:
FORCEINLINE void SetHUDPackage(const FHUDPackage& Package) { HUDPackage = Package; };
};