2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-06-10 13:56:35 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
2014-08-21 20:30:51 -04:00
|
|
|
#include "GameplayDebuggingTypes.h"
|
2014-06-10 13:56:35 -04:00
|
|
|
#include "GameplayDebuggingReplicator.generated.h"
|
|
|
|
|
/**
|
|
|
|
|
* Transient actor used to communicate between server and client, mostly for RPC
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class UGameplayDebuggingComponent;
|
|
|
|
|
class AGameplayDebuggingHUDComponent;
|
|
|
|
|
|
2014-08-07 17:34:29 -04:00
|
|
|
DECLARE_MULTICAST_DELEGATE_OneParam(FOnSelectionChanged, class AActor*);
|
|
|
|
|
|
2014-09-03 07:31:18 -04:00
|
|
|
UCLASS(config = Engine, NotBlueprintable, Transient, hidecategories = Actor, notplaceable)
|
2014-06-10 13:56:35 -04:00
|
|
|
class GAMEPLAYDEBUGGER_API AGameplayDebuggingReplicator : public AActor
|
|
|
|
|
{
|
2015-03-17 05:38:32 -04:00
|
|
|
GENERATED_UCLASS_BODY()
|
2014-06-10 13:56:35 -04:00
|
|
|
|
|
|
|
|
UPROPERTY(config)
|
|
|
|
|
FString DebugComponentClassName;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(config)
|
|
|
|
|
FString DebugComponentHUDClassName;
|
|
|
|
|
|
2014-12-11 11:44:40 -05:00
|
|
|
UPROPERTY(config)
|
|
|
|
|
FString DebugComponentControllerClassName;
|
|
|
|
|
|
2014-09-22 15:19:39 -04:00
|
|
|
UPROPERTY(config)
|
|
|
|
|
int32 MaxEQSQueries;
|
|
|
|
|
|
2014-06-10 13:56:35 -04:00
|
|
|
UPROPERTY(Replicated, Transient)
|
|
|
|
|
UGameplayDebuggingComponent* DebugComponent;
|
|
|
|
|
|
2014-06-25 09:28:40 -04:00
|
|
|
UPROPERTY(Replicated, Transient)
|
|
|
|
|
APlayerController* LocalPlayerOwner;
|
|
|
|
|
|
2014-09-09 12:17:30 -04:00
|
|
|
UPROPERTY(Replicated, Transient)
|
|
|
|
|
AActor* LastSelectedActorToDebug;
|
|
|
|
|
|
2014-08-07 17:34:29 -04:00
|
|
|
UPROPERTY(Replicated, Transient)
|
|
|
|
|
bool bIsGlobalInWorld;
|
|
|
|
|
|
2014-10-01 08:53:33 -04:00
|
|
|
UPROPERTY(ReplicatedUsing = OnRep_AutoActivate, Transient)
|
|
|
|
|
bool bAutoActivate;
|
|
|
|
|
|
2014-09-09 12:17:30 -04:00
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView")
|
|
|
|
|
bool OverHead;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView")
|
|
|
|
|
bool Basic;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView")
|
|
|
|
|
bool BehaviorTree;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView|EQS")
|
|
|
|
|
bool EQS;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView|EQS", meta = (EditCondition = "EQS"))
|
|
|
|
|
bool EnableEQSOnHUD;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView|EQS", meta = (EditCondition = "EQS"))
|
|
|
|
|
int32 ActiveEQSIndex;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView")
|
|
|
|
|
bool Perception;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView")
|
|
|
|
|
bool GameView1;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView")
|
|
|
|
|
bool GameView2;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView")
|
|
|
|
|
bool GameView3;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = "DataView")
|
|
|
|
|
bool GameView4;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Transient, EditAnywhere, Category = DataView)
|
|
|
|
|
bool GameView5;
|
|
|
|
|
|
2015-02-23 15:58:14 -05:00
|
|
|
UPROPERTY()
|
|
|
|
|
class UTexture2D* DefaultTexture_Red;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
class UTexture2D* DefaultTexture_Green;
|
|
|
|
|
|
2015-03-17 05:38:32 -04:00
|
|
|
UFUNCTION(reliable, server, WithValidation)
|
2014-06-10 13:56:35 -04:00
|
|
|
void ServerReplicateMessage(class AActor* Actor, uint32 InMessage, uint32 DataView = 0);
|
|
|
|
|
|
2015-03-17 05:38:32 -04:00
|
|
|
UFUNCTION(reliable, client, WithValidation)
|
2014-06-10 13:56:35 -04:00
|
|
|
void ClientReplicateMessage(class AActor* Actor, uint32 InMessage, uint32 DataView = 0);
|
|
|
|
|
|
2015-03-17 05:38:32 -04:00
|
|
|
UFUNCTION(Reliable, Client)
|
2015-02-23 15:58:14 -05:00
|
|
|
void ClientAutoActivate();
|
|
|
|
|
|
2015-03-17 05:38:32 -04:00
|
|
|
UFUNCTION(Reliable, Client, WithValidation)
|
2015-02-19 07:14:31 -05:00
|
|
|
void ClientEnableTargetSelection(bool bEnable, APlayerController* Context);
|
2014-06-10 13:56:35 -04:00
|
|
|
|
2014-09-09 12:17:30 -04:00
|
|
|
#if WITH_EDITOR
|
|
|
|
|
void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-10-01 08:53:33 -04:00
|
|
|
UFUNCTION()
|
|
|
|
|
virtual void OnRep_AutoActivate();
|
|
|
|
|
|
2015-04-03 17:34:52 -04:00
|
|
|
virtual class UNetConnection* GetNetConnection() const override;
|
2014-06-10 13:56:35 -04:00
|
|
|
|
2015-04-03 17:34:52 -04:00
|
|
|
virtual bool IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const override;
|
2014-06-10 13:56:35 -04:00
|
|
|
|
2015-02-23 15:58:14 -05:00
|
|
|
virtual void PostNetInit() override;
|
|
|
|
|
|
2014-06-10 13:56:35 -04:00
|
|
|
virtual void PostInitializeComponents() override;
|
|
|
|
|
|
|
|
|
|
virtual void BeginPlay() override;
|
|
|
|
|
|
2014-08-07 17:34:29 -04:00
|
|
|
virtual void TickActor(float DeltaTime, enum ELevelTick TickType, FActorTickFunction& ThisTickFunction) override;
|
|
|
|
|
|
2014-06-25 09:28:40 -04:00
|
|
|
UGameplayDebuggingComponent* GetDebugComponent();
|
2014-06-10 13:56:35 -04:00
|
|
|
|
|
|
|
|
bool IsToolCreated();
|
2014-06-25 09:28:40 -04:00
|
|
|
void CreateTool();
|
2014-06-10 13:56:35 -04:00
|
|
|
void EnableTool();
|
|
|
|
|
bool IsDrawEnabled();
|
|
|
|
|
void EnableDraw(bool bEnable);
|
2014-08-07 17:34:29 -04:00
|
|
|
void SetAsGlobalInWorld(bool IsGlobal) { bIsGlobalInWorld = IsGlobal; }
|
|
|
|
|
bool IsGlobalInWorld() { return bIsGlobalInWorld; }
|
2014-06-25 09:28:40 -04:00
|
|
|
|
|
|
|
|
void SetLocalPlayerOwner(APlayerController* PC) { LocalPlayerOwner = PC; }
|
|
|
|
|
APlayerController* GetLocalPlayerOwner() { return LocalPlayerOwner; }
|
|
|
|
|
|
2014-09-09 12:17:30 -04:00
|
|
|
FORCEINLINE AActor* GetSelectedActorToDebug() { return LastSelectedActorToDebug; }
|
2015-02-19 07:14:31 -05:00
|
|
|
|
2015-03-17 05:38:32 -04:00
|
|
|
UFUNCTION(reliable, server, WithValidation)
|
2015-02-19 07:14:31 -05:00
|
|
|
void ServerSetActorToDebug(AActor* InActor);
|
2014-08-07 17:34:29 -04:00
|
|
|
|
2015-01-15 11:57:16 -05:00
|
|
|
/**
|
|
|
|
|
* Iterates through the pawn list to find the next pawn of the specified type to debug
|
|
|
|
|
*/
|
|
|
|
|
void DebugNextPawn(UClass* CompareClass, APawn* CurrentPawn = nullptr);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Iterates through the pawn list to find the previous pawn of the specified type to debug
|
|
|
|
|
*/
|
|
|
|
|
void DebugPrevPawn(UClass* CompareClass, APawn* CurrentPawn = nullptr);
|
|
|
|
|
|
2014-06-25 09:28:40 -04:00
|
|
|
uint32 DebuggerShowFlags;
|
2014-06-10 13:56:35 -04:00
|
|
|
|
2014-08-07 17:34:29 -04:00
|
|
|
static FOnSelectionChanged OnSelectionChangedDelegate;
|
2014-08-21 20:30:51 -04:00
|
|
|
FOnChangeEQSQuery OnChangeEQSQuery;
|
2014-06-10 13:56:35 -04:00
|
|
|
protected:
|
|
|
|
|
void OnDebugAIDelegate(class UCanvas* Canvas, class APlayerController* PC);
|
|
|
|
|
void DrawDebugDataDelegate(class UCanvas* Canvas, class APlayerController* PC);
|
|
|
|
|
void DrawDebugData(class UCanvas* Canvas, class APlayerController* PC);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
uint32 bEnabledDraw : 1;
|
|
|
|
|
uint32 LastDrawAtFrame;
|
2014-08-07 17:34:29 -04:00
|
|
|
float PlayerControllersUpdateDelay;
|
2014-06-10 13:56:35 -04:00
|
|
|
|
|
|
|
|
TWeakObjectPtr<UClass> DebugComponentClass;
|
|
|
|
|
TWeakObjectPtr<UClass> DebugComponentHUDClass;
|
2014-12-11 11:44:40 -05:00
|
|
|
TWeakObjectPtr<UClass> DebugComponentControllerClass;
|
2014-06-10 13:56:35 -04:00
|
|
|
TWeakObjectPtr<AGameplayDebuggingHUDComponent> DebugRenderer;
|
|
|
|
|
};
|