Files
UnrealEngineUWP/Engine/Source/Developer/GameplayDebugger/Classes/GameplayDebuggingReplicator.h
Josh Markiewicz c18a424666 Weekly Fort Dev -> Main integration from UE4-Fortnite-CL-2245134
MCP
 "app" : "fortnite",
  "moduleName" : "Fortnite-PublicService",
  "branch" : "TRUNK",
  "build" : "306",
  "cln" : "2245028",
  "version" : "UNKNOWN"

[CL 2247600 by Josh Markiewicz in Main branch]
2014-08-07 17:34:29 -04:00

92 lines
2.8 KiB
C++

// 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;
DECLARE_MULTICAST_DELEGATE_OneParam(FOnSelectionChanged, class AActor*);
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;
UPROPERTY(Replicated, Transient)
APlayerController* LocalPlayerOwner;
UPROPERTY(Replicated, Transient)
bool bIsGlobalInWorld;
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;
virtual void BeginDestroy() override;
virtual void TickActor(float DeltaTime, enum ELevelTick TickType, FActorTickFunction& ThisTickFunction) override;
UGameplayDebuggingComponent* GetDebugComponent();
bool IsToolCreated();
void CreateTool();
void EnableTool();
bool IsDrawEnabled();
void EnableDraw(bool bEnable);
void SetAsGlobalInWorld(bool IsGlobal) { bIsGlobalInWorld = IsGlobal; }
bool IsGlobalInWorld() { return bIsGlobalInWorld; }
void SetLocalPlayerOwner(APlayerController* PC) { LocalPlayerOwner = PC; }
APlayerController* GetLocalPlayerOwner() { return LocalPlayerOwner; }
FORCEINLINE AActor* GetSelectedActorToDebug() { return LastSelectedActorInSimulation.Get(); }
void SetActorToDebug(AActor* InActor);
uint32 DebuggerShowFlags;
static FOnSelectionChanged OnSelectionChangedDelegate;
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;
float PlayerControllersUpdateDelay;
TWeakObjectPtr<UClass> DebugComponentClass;
TWeakObjectPtr<UClass> DebugComponentHUDClass;
TWeakObjectPtr<AGameplayDebuggingHUDComponent> DebugRenderer;
TWeakObjectPtr<AActor> LastSelectedActorInSimulation;
};