LEAP Documentation 40220
Documentation for the LEAP project
RadarIconWidget.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2022. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Blueprint/UserWidget.h"
7#include "WeakInterfacePtr.h"
11#include "RadarIconWidget.generated.h"
12
13class UImage;
14class UTextBlock;
15class URadarWidget;
16class UCanvasPanelSlot;
19
20UCLASS()
21class PROJECTX_API URadarIconWidget : public UUserWidget
22{
23 GENERATED_BODY()
24
25public:
26 UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
27 UImage* Blip = nullptr;
28 UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
29 UImage* UpArrow = nullptr;
30 UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
31 UImage* DownArrow = nullptr;
32 UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
33 UTextBlock* Label = nullptr;
34 UPROPERTY(Transient, BlueprintReadWrite)
35 TWeakObjectPtr<AActor> TrackedActor = nullptr;
36 UPROPERTY(Transient, BlueprintReadWrite)
37 TWeakObjectPtr<URadarWidget> Radar = nullptr;
38 UPROPERTY(BlueprintReadWrite)
39 bool bIsTrackedActorDead = false;
40 /* Height difference that will cause the actor up or down arrows to be revealed */
41 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
42 float ZDistance = 1000.0f;
43 /* Colour of own radar dot */
44 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
45 FLinearColor SelfColour = FLinearColor(1.0f, 0.964583f, 0.0f, 1.0f);
46
47 UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
48 void Init();
49 UFUNCTION(BlueprintCallable)
50 void RemoveIcon();
51 UFUNCTION(BlueprintCallable)
52 void UpdateIconBasedOnTeam();
53 UFUNCTION(BlueprintCallable)
54 void UpdateIconBasedOnSquad();
55 UFUNCTION(BlueprintCallable)
56 void UpdateVisibility();
57 UFUNCTION(BlueprintCallable)
58 void EvaluateVisibilityAsSelfOrEnemy(AProjectXCharacter* const TrackedCharacter);
59 UFUNCTION(BlueprintPure)
60 AActor* GetReferenceActor() const;
61
62 UFUNCTION()
63 void OnActorStopTracking(const AActor* const Actor);
64
65 FTimerHandle TickTimerHandle;
66private:
67 void SlowTick();
68 void Tick();
69 bool bHasUpdatedPositionOnce = false;
70 UCanvasPanelSlot* CanvasSlot = nullptr;
71 TWeakInterfacePtr<ITrackableInterface> TrackableInterface = nullptr;
72 TWeakInterfacePtr<IHealthInterface> HealthInterface = nullptr;
73 TWeakInterfacePtr<IOwnedInterface> OwnedInterface = nullptr;
74 APlayerController* OwningPlayer = nullptr;
75 UProjectXGameInstance* GameInstance = nullptr;
76 FLinearColor SquadmateColour;
77};
Definition: ProjectXCharacter.h:128
Definition: HealthInterface.h:28
Definition: OwnedInterface.h:20
Definition: TrackableInterface.h:22
Definition: ProjectXGameInstance.h:507
FLinearColor SquadmateColour
Definition: ProjectXGameInstance.h:769
virtual void Init() override
Definition: ProjectXGameInstance.cpp:219
Definition: RadarIconWidget.h:22
Definition: RadarWidget.h:14