Space Plunder
Loading...
Searching...
No Matches
InteractionPingWidget.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 "Data/BaseData.h"
9#include "InteractionPingWidget.generated.h"
10
14UCLASS()
15class INTERACTION_API UInteractionPingWidget : public UUserWidget
16{
17 GENERATED_BODY()
18
19 //@TODO Parent this to Waypoint Widget in Base Helpers
20
21public:
22
23 virtual bool Initialize() override;
24 virtual void NativeConstruct() override;
25
26 void ActorConstruct();
27 virtual void NativeDestruct() override;
28
29 UFUNCTION(BlueprintCallable, Category="Interaction")
30 void SetPingData(const FPingData& Ping, AActor* Sender);
31 UFUNCTION(BlueprintImplementableEvent, Category="Interaction")
32 void OnReceivePingData(const FPingData& Ping, const AActor* Sender);
33
34
35 UFUNCTION(BlueprintCallable, Category="Interaction")
36 void SetPingActor(AActor* Actor) {PingActor = Actor;};
37
38 UFUNCTION(BlueprintCallable, Category="Interaction")
39 void SetDistanceText();
40
41
42 UFUNCTION(BlueprintCallable, Category="Interaction")
43 float GetDistance(const bool bMeters = true) const;
44
45protected:
46 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(BindWidget), Category="Interaction")
47 class UImage* PingIcon;
48 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(BindWidget), Category="Interaction")
49 class UTextBlock* ContextTextBlock;
50 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(BindWidget), Category="Interaction")
51 class UTextBlock* DistanceTextBlock;
52
53 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Interaction")
54 bool bUseDistance = true;
55 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Interaction",meta=(EditCondition=bUseDistance))
56 float DistanceUpdateSpeed = 0.5f;
57
58 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Interaction")
59 AActor* PingActor;
60 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Interaction")
61 AActor* OwnerActor;
62
63private:
64
65 void GetOwnerActor();
66
67 FTimerHandle DistanceTimerHandle;
68 FNumberFormattingOptions NumberFormatOptions;
69};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition Interaction.Build.cs:6
Definition InteractionPingWidget.h:16
Definition InteractionData.h:37