Space Plunder
Loading...
Searching...
No Matches
HealthHUDWidget.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Blueprint/UserWidget.h"
8#include "HealthHUDWidget.generated.h"
9
15UCLASS()
16class HEALTH_API UHealthHUDWidget : public UUserWidget, public IHealthInterface
17{
18 GENERATED_BODY()
19
20public:
21 virtual void NativePreConstruct() override;
22 virtual void NativeConstruct() override;
23
24 //~ Health Interface ~//
25 virtual void HealthChanged(const float Health, const float MaxHealth,const class UDamageType* DamageType) override;
26 virtual void HealthAndShieldChanged(const float Health, const float MaxHealth, const float ShieldHealth, const float MaxShieldHealth, const class UDamageType* DamageType) override;
27 virtual void ShieldBreak() override;
28 virtual void InjuredBodyPart(const EBodyPartName InjuredBodyPart, const FVector& HitLocation, const TArray<FBodyPart>& AllBodyParts) override;
29 virtual void SetHasShield(const bool bHasShield) override;
30 //~ Health Interface ~//
31
32
33protected:
34
35 virtual bool Initialize() override;
36
37 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="HUD|Health")
38 FLinearColor HealthColor = FLinearColor(0.548611f, 0.0f, 0.0f, 0.0f);
39 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="HUD|Health")
40 FLinearColor ShieldColor = FLinearColor(0.1f, 0.0f, 0.5f, 0.0f);
41
42 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="HUD|Health")
43 UMaterialInterface* DamageVignetteMaterial = nullptr;
44
45 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="HUD|Health")
46 UMaterialInstanceDynamic* DamageVignette = nullptr;
47
48
49 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="HUD|Health", meta=(BindWidget))
50 class UHealthWidget* HealthWidget = nullptr;
51 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="HUD|Health", meta=(BindWidget))
52 class UImage* LowHealthImage = nullptr;
53
54
55
56 void ApplyDamageMaterial();
57
58private:
59 bool bShield = false;
60};
61
EBodyPartName
Definition BaseData.h:133
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition Health.Build.cs:6
Definition HealthInterface.h:19
A widget class used for displaying health-related information in the HUD. Including Health Bar & Low ...
Definition HealthHUDWidget.h:17
Definition HealthWidget.h:13