LEAP Documentation 40220
Documentation for the LEAP project
KillCameraComponent.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
8#include "KillCameraComponent.generated.h"
9
13class UWidgetComponent;
14class UActorComponent;
15class ASpectatorPawn;
16class IKillCameraInterface;
17
18DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FKillCamEndSignature,float, BlendTime);
19DECLARE_DYNAMIC_MULTICAST_DELEGATE(FKillCamFocusSignature);
20
21UCLASS( ClassGroup=(Custom), BlueprintType, Blueprintable, meta=(BlueprintSpawnableComponent) )
22class PROJECTX_API UKillCameraComponent : public UActorComponent, public IReactsToMatchEvents
23{
24 GENERATED_UCLASS_BODY()
25
26public:
27 UFUNCTION(BlueprintCallable, Category = "Kill Camera")
28 class AProjectXPlayerController* GetPlayerController() const;
29 UFUNCTION(BlueprintCallable, Category = "Kill Camera")
30 void EndKillCamera(bool bFireEndEvent = false);
31 UFUNCTION(BlueprintCallable, Category = "Kill Camera")
32 AKillCameraActor* GetKillCameraActor() const { return KillCameraActor.IsValid() ? KillCameraActor.Get() : NULL; }
33
34 virtual void MatchEnded() override;
35 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
36 virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
37 void InitializeKillCamera(AProjectXCharacter* Killed, AActor* Killer, AProjectXPlayerState* KillerState, const FDamageEvent& DamageEvent);
38
39 UPROPERTY(BlueprintAssignable, Category = "Kill Camera|Events")
40 FKillCamEndSignature OnKillCamEnd;
41
42 UPROPERTY(BlueprintAssignable,BlueprintCallable)
43 FKillCamFocusSignature OnKillCamFocusVictim;
44 UPROPERTY(BlueprintAssignable, BlueprintCallable)
45 FKillCamFocusSignature OnKillCamFocusKiller;
46
47protected:
48 UFUNCTION(BlueprintImplementableEvent, Category = "Kill Camera", meta = (DisplayName = "Initialize Kill Camera"))
49 void OnKillCameraInitialized(AProjectXCharacter* Killed, AActor* Killer, AProjectXPlayerState* KillerState, TSubclassOf<UDamageType> DamageType) const;
50 UFUNCTION(BlueprintImplementableEvent, Category = "Kill Camera", meta = (DisplayName = "On Spectator Pawn Available"))
51 void OnSpectatorPawnAvailable(ASpectatorPawn* SpectatorPawn) const;
52 UFUNCTION(BlueprintImplementableEvent, Category = "Kill Camera", meta = (DisplayName = "On Killer Camera Component Registered"))
53 void OnKillCamComponentRegistered(UActorComponent* ObjectRegistered) const;
54 UFUNCTION(BlueprintCallable, Category = "Kill Camera")
55 bool CanLookAtKiller() const;
56 AKillCameraActor* SpawnKillCameraActor(AActor* Actor);
57 void CheckAndWaitForSpectatorPawn();
58 void SpectatorPawnAvailable(ASpectatorPawn* SpectatorPawn);
59 void RegisterKillCamComponent(UActorComponent* Component);
60 void CleanUpComponents();
61
62 UPROPERTY(EditDefaultsOnly, Category = "Kill Camera")
63 TSubclassOf<UWidgetComponent> KillCamWidgetComponentClass = NULL;
64 UPROPERTY(EditDefaultsOnly, Category = "Kill Camera")
65 float BlendToBeaconTime = 1.0f;
66 UPROPERTY(EditDefaultsOnly, Category = "Kill Camera")
67 float WaitTimeBeforeBlendingToSpawnBecon = 2.0f;
68
69 FTimerHandle WaitToBlendTimerHandle;
70
71 TArray<TWeakObjectPtr<UActorComponent>> KillCamComponents;
72 TWeakObjectPtr<AActor> KilledActor = NULL;
73 TWeakObjectPtr<AActor> KillerActor = NULL;
74 TWeakObjectPtr<ASpectatorPawn> KillCamSpectatorPawn = NULL;
75 TWeakObjectPtr<AKillCameraActor> KillCameraActor = NULL;
76 TArray<TWeakObjectPtr<AActor>> NearbyKillCamInterfaces;
77};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FKillCamFocusSignature)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FKillCamEndSignature, float, BlendTime)
Definition: KillCameraActor.h:19
Definition: ProjectXCharacter.h:128
Definition: ProjectXPlayerController.h:83
Definition: ProjectXPlayerState.h:238
Definition: ReactsToMatchEvents.h:16
virtual void MatchEnded()
Definition: ReactsToMatchEvents.cpp:16