Space Plunder
Loading...
Searching...
No Matches
IncomingThreatWidget.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"
7#include "IncomingThreatWidget.generated.h"
8
15UCLASS()
16class BASEHELPERS_API UIncomingThreatWidget : public UUserWidget
17{
18 GENERATED_BODY()
19
20public:
21
22 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
23 void StartThreatIndicationFromActor(AActor* ActorThreat, const float Amount = -1.0f, const UDamageType* DamageType = nullptr);
24 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
25 void StartThreatIndicationFromLocation(const FVector& Location, const float Amount = -1.0f, const UDamageType* DamageType = nullptr);
26 UFUNCTION(BlueprintImplementableEvent, Category = "Base Helpers")
27 void OnStartThreatIndication(const bool bActor, const bool bLocation);
28
29
30
31 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
32 void UpdateThreatIndication(const FVector& Location, const float DetectionAmount);
33 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
34 void StopThreatIndication();
35
36 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
37 void SetLifetime(const float Life){Lifetime = Life;};
38
39
40protected:
41 virtual bool Initialize() override;
42 virtual void NativePreConstruct() override;
43 virtual void NativeConstruct() override;
44
45 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Threat")
46 class UBorder* ThreatBorder = nullptr;
47
48 // UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Threat")
49 // class UImage* ThreatImage = nullptr;
50 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Threat")
51 UMaterialInstanceDynamic* ThreatMaterial = nullptr;
52
53 //
54 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Threat")
55 float UpdateRate = 0.01f;
56
57 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Threat")
58 float Lifetime = 4.0f;
59 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Threat")
60 float MaxIntensity = 100.0f;
61
62 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Threat")
63 float Intensity = -1.0f;
64
65 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Threat")
66 float Progress = 0.0f;
67 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Threat")
68 FVector TargetLocation = FVector::ZeroVector;
69 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Threat")
70 AActor* TargetActor = nullptr;
71 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Threat")
72 UDamageType* TargetDamageType = nullptr;
73private:
74
75 void OptimizedTick() const;
76
77 void SetThreatAngle() const;
78 void SetThreatIntensity() const;
79 //- SetThreatPercent //
80 void Destroy();
81
82 FTimerHandle LifetimeTimerHandle;
83 FTimerHandle UpdateRateTimerHandle;
84
85};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Base class for Damage Indicator & AI Threat Detector.
Definition IncomingThreatWidget.h:17