-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWotUWHealthBar.h
54 lines (39 loc) · 1.27 KB
/
WotUWHealthBar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include "CoreMinimal.h"
#include "UI/WotUserWidget.h"
#include "WotUWHealthBar.generated.h"
class UWotProgressBar;
class UWotTextBlock;
UCLASS()
class VOXELRPG_API UWotUWHealthBar : public UWotUserWidget
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable)
void SetHealth(float NewHealthStart, float NewHealthEnd, float HealthMax);
UFUNCTION(BlueprintCallable)
void SetFillColor(FLinearColor& NewFillColor);
virtual void SetDuration(float NewDuration) override;
UFUNCTION(BlueprintCallable)
void PlayTextUpdateAnimation();
protected:
// Doing setup in the C++ constructor is not as
// useful as using NativeConstruct.
void NativeConstruct() override;
void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override;
UPROPERTY( meta = ( BindWidget ) )
UWotProgressBar* HealthBar;
UPROPERTY( meta = ( BindWidget ) )
UWotTextBlock* CurrentHealthLabel;
UPROPERTY( meta = ( BindWidget ) )
UWotTextBlock* MaxHealthLabel;
UPROPERTY( Transient, meta = ( BindWidgetAnimOptional ) )
UWidgetAnimation* TextUpdateAnim;
float HealthStart;
float HealthCurrent;
float HealthEnd;
float HealthMax;
float TimeRemaining{0};
UFUNCTION()
void UpdateHealth(float Interpolation);
};