2014-06-10 13:56:35 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#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-06-10 13:56:35 -04:00
|
|
|
UCLASS(config=Engine, NotBlueprintable, Transient)
|
|
|
|
|
class GAMEPLAYDEBUGGER_API AGameplayDebuggingReplicator : public AActor
|
|
|
|
|
{
|
|
|
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
|
|
|
|
|
|
UPROPERTY(config)
|
|
|
|
|
FString DebugComponentClassName;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(config)
|
|
|
|
|
FString DebugComponentHUDClassName;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(Replicated, Transient)
|
|
|
|
|
UGameplayDebuggingComponent* DebugComponent;
|
|
|
|
|
|
2014-06-25 09:28:40 -04:00
|
|
|
UPROPERTY(Replicated, Transient)
|
|
|
|
|
APlayerController* LocalPlayerOwner;
|
|
|
|
|
|
2014-08-07 17:34:29 -04:00
|
|
|
UPROPERTY(Replicated, Transient)
|
|
|
|
|
bool bIsGlobalInWorld;
|
|
|
|
|
|
2014-06-10 13:56:35 -04:00
|
|
|
UFUNCTION(reliable, server, WithValidation)
|
|
|
|
|
void ServerReplicateMessage(class AActor* Actor, uint32 InMessage, uint32 DataView = 0);
|
|
|
|
|
|
|
|
|
|
UFUNCTION(reliable, client, WithValidation)
|
|
|
|
|
void ClientReplicateMessage(class AActor* Actor, uint32 InMessage, uint32 DataView = 0);
|
|
|
|
|
|
|
|
|
|
UFUNCTION(reliable, server, WithValidation)
|
|
|
|
|
void ServerEnableTargetSelection(bool bEnable, APlayerController* Context);
|
|
|
|
|
|
|
|
|
|
virtual class UNetConnection* GetNetConnection() override;
|
|
|
|
|
|
|
|
|
|
virtual bool IsNetRelevantFor(class APlayerController* RealViewer, AActor* Viewer, const FVector& SrcLocation) override;
|
|
|
|
|
|
|
|
|
|
virtual void PostInitializeComponents() override;
|
|
|
|
|
|
|
|
|
|
virtual void BeginPlay() override;
|
|
|
|
|
|
2014-08-07 17:34:29 -04:00
|
|
|
virtual void BeginDestroy() override;
|
|
|
|
|
|
|
|
|
|
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-08-07 17:34:29 -04:00
|
|
|
FORCEINLINE AActor* GetSelectedActorToDebug() { return LastSelectedActorInSimulation.Get(); }
|
|
|
|
|
void SetActorToDebug(AActor* InActor);
|
|
|
|
|
|
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-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;
|
|
|
|
|
|
|
|
|
|
TWeakObjectPtr<AGameplayDebuggingHUDComponent> DebugRenderer;
|
2014-06-11 09:13:09 -04:00
|
|
|
TWeakObjectPtr<AActor> LastSelectedActorInSimulation;
|
2014-06-10 13:56:35 -04:00
|
|
|
};
|