|
|
|
|
| #pragma once
|
|
|
| #include "Camera/LyraCameraAssistInterface.h"
|
| #include "CommonPlayerController.h"
|
| #include "Teams/LyraTeamAgentInterface.h"
|
|
|
| #include "LyraPlayerController.generated.h"
|
|
|
| #define UE_API LYRAGAME_API
|
|
|
| struct FGenericTeamId;
|
|
|
| class ALyraHUD;
|
| class ALyraPlayerState;
|
| class APawn;
|
| class APlayerState;
|
| class FPrimitiveComponentId;
|
| class IInputInterface;
|
| class ULyraAbilitySystemComponent;
|
| class ULyraSettingsShared;
|
| class UObject;
|
| class UPlayer;
|
| struct FFrame;
|
|
|
| |
| |
| |
| |
|
|
| UCLASS(MinimalAPI, Config = Game, Meta = (ShortTooltip = "The base player controller class used by this project."))
|
| class ALyraPlayerController : public ACommonPlayerController, public ILyraCameraAssistInterface, public ILyraTeamAgentInterface
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
|
|
| UE_API ALyraPlayerController(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|PlayerController")
|
| UE_API ALyraPlayerState* GetLyraPlayerState() const;
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|PlayerController")
|
| UE_API ULyraAbilitySystemComponent* GetLyraAbilitySystemComponent() const;
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|PlayerController")
|
| UE_API ALyraHUD* GetLyraHUD() const;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|PlayerController")
|
| UE_API bool TryToRecordClientReplay();
|
|
|
|
|
| UE_API virtual bool ShouldRecordClientReplay();
|
|
|
|
|
| UFUNCTION(Reliable, Server, WithValidation)
|
| UE_API void ServerCheat(const FString& Msg);
|
|
|
|
|
| UFUNCTION(Reliable, Server, WithValidation)
|
| UE_API void ServerCheatAll(const FString& Msg);
|
|
|
|
|
| UE_API virtual void PreInitializeComponents() override;
|
| UE_API virtual void BeginPlay() override;
|
| UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
| UE_API virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
|
|
|
|
|
|
|
| UE_API virtual void OnPossess(APawn* InPawn) override;
|
| UE_API virtual void OnUnPossess() override;
|
| UE_API virtual void InitPlayerState() override;
|
| UE_API virtual void CleanupPlayerState() override;
|
| UE_API virtual void OnRep_PlayerState() override;
|
|
|
|
|
|
|
| UE_API virtual void ReceivedPlayer() override;
|
| UE_API virtual void PlayerTick(float DeltaTime) override;
|
| UE_API virtual void SetPlayer(UPlayer* InPlayer) override;
|
| UE_API virtual void AddCheats(bool bForce) override;
|
| UE_API virtual void UpdateForceFeedback(IInputInterface* InputInterface, const int32 ControllerId) override;
|
| UE_API virtual void UpdateHiddenComponents(const FVector& ViewLocation, TSet<FPrimitiveComponentId>& OutHiddenComponents) override;
|
| UE_API virtual void PreProcessInput(const float DeltaTime, const bool bGamePaused) override;
|
| UE_API virtual void PostProcessInput(const float DeltaTime, const bool bGamePaused) override;
|
|
|
|
|
|
|
| UE_API virtual void OnCameraPenetratingTarget() override;
|
|
|
|
|
|
|
| UE_API virtual void SetGenericTeamId(const FGenericTeamId& NewTeamID) override;
|
| UE_API virtual FGenericTeamId GetGenericTeamId() const override;
|
| UE_API virtual FOnLyraTeamIndexChangedDelegate* GetOnTeamIndexChangedDelegate() override;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|Character")
|
| UE_API void SetIsAutoRunning(const bool bEnabled);
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|Character")
|
| UE_API bool GetIsAutoRunning() const;
|
|
|
| private:
|
| UPROPERTY()
|
| FOnLyraTeamIndexChangedDelegate OnTeamChangedDelegate;
|
|
|
| UPROPERTY()
|
| TObjectPtr<APlayerState> LastSeenPlayerState;
|
|
|
| private:
|
| UFUNCTION()
|
| void OnPlayerStateChangedTeam(UObject* TeamAgent, int32 OldTeam, int32 NewTeam);
|
|
|
| protected:
|
|
|
| UE_API virtual void OnPlayerStateChanged();
|
|
|
| private:
|
| void BroadcastOnPlayerStateChanged();
|
|
|
| protected:
|
|
|
|
|
|
|
|
|
|
|
| UE_API void OnSettingsChanged(ULyraSettingsShared* Settings);
|
|
|
| UE_API void OnStartAutoRun();
|
| UE_API void OnEndAutoRun();
|
|
|
| UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName="OnStartAutoRun"))
|
| UE_API void K2_OnStartAutoRun();
|
|
|
| UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName="OnEndAutoRun"))
|
| UE_API void K2_OnEndAutoRun();
|
|
|
| bool bHideViewTargetPawnNextFrame = false;
|
| };
|
|
|
|
|
|
|
| UCLASS()
|
| class ALyraReplayPlayerController : public ALyraPlayerController
|
| {
|
| GENERATED_BODY()
|
|
|
| virtual void Tick(float DeltaSeconds) override;
|
| virtual void SmoothTargetViewRotation(APawn* TargetPawn, float DeltaSeconds) override;
|
| virtual bool ShouldRecordClientReplay() override;
|
|
|
|
|
| void RecorderPlayerStateUpdated(APlayerState* NewRecorderPlayerState);
|
|
|
|
|
| UFUNCTION()
|
| void OnPlayerStatePawnSet(APlayerState* ChangedPlayerState, APawn* NewPlayerPawn, APawn* OldPlayerPawn);
|
|
|
|
|
| UPROPERTY(Transient)
|
| TObjectPtr<APlayerState> FollowedPlayerState;
|
| };
|
|
|
| #undef UE_API
|
|
|