Files
UnrealEngineUWP/Engine/Source/Developer/GameplayDebugger/Public/GameplayDebuggerConfig.h
yoan stamant ce31754333 [GameplayDebugger] viewer can now provide view location and direction to the replicator so detaching camera from controller is supported properly for actor picking and culling tests
added view distance and angle to config and updated actor picking + culling
#rb maxime.mercier, mieszko.zielinski
#preflight 61a917f61a368fd603a10e4f

#ROBOMERGE-AUTHOR: yoan.stamant
#ROBOMERGE-SOURCE: CL 18355593 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v895-18170469)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 18355643 by yoan stamant in ue5-release-engine-test branch]
2021-12-02 14:38:50 -05:00

252 lines
7.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "UObject/Object.h"
#include "InputCoreTypes.h"
#include "Engine/DeveloperSettings.h"
#include "GameplayDebuggerConfig.generated.h"
struct FGameplayDebuggerInputModifier;
UENUM()
enum class EGameplayDebuggerOverrideMode : uint8
{
Enable,
Disable,
UseDefault,
};
USTRUCT()
struct FGameplayDebuggerInputConfig
{
GENERATED_USTRUCT_BODY()
FGameplayDebuggerInputConfig()
: bModShift(false)
, bModCtrl(false)
, bModAlt(false)
, bModCmd(false) {}
UPROPERTY(VisibleAnywhere, Category = Input)
FString ConfigName;
UPROPERTY(EditAnywhere, Category = Input)
FKey Key;
UPROPERTY(EditAnywhere, Category = Input)
uint32 bModShift : 1;
UPROPERTY(EditAnywhere, Category = Input)
uint32 bModCtrl : 1;
UPROPERTY(EditAnywhere, Category = Input)
uint32 bModAlt : 1;
UPROPERTY(EditAnywhere, Category = Input)
uint32 bModCmd : 1;
};
USTRUCT()
struct FGameplayDebuggerCategoryConfig
{
GENERATED_USTRUCT_BODY()
UPROPERTY(VisibleAnywhere, Category = Settings)
FString CategoryName;
UPROPERTY(EditAnywhere, Category = Settings, meta = (EditCondition = "bOverrideSlotIdx", ClampMin = -1, ClampMax = 9, UIMin = -1, UIMax = 9))
int32 SlotIdx;
UPROPERTY(EditAnywhere, Category = Settings)
EGameplayDebuggerOverrideMode ActiveInGame;
UPROPERTY(EditAnywhere, Category = Settings)
EGameplayDebuggerOverrideMode ActiveInSimulate;
UPROPERTY(EditAnywhere, Category = Settings)
EGameplayDebuggerOverrideMode Hidden;
UPROPERTY(EditAnywhere, Category = Settings, AdvancedDisplay)
uint32 bOverrideSlotIdx : 1;
UPROPERTY(EditAnywhere, Category = Settings, EditFixedSize)
TArray<FGameplayDebuggerInputConfig> InputHandlers;
FGameplayDebuggerCategoryConfig()
: SlotIdx(0)
, ActiveInGame(EGameplayDebuggerOverrideMode::UseDefault)
, ActiveInSimulate(EGameplayDebuggerOverrideMode::UseDefault)
, Hidden(EGameplayDebuggerOverrideMode::UseDefault)
, bOverrideSlotIdx(false)
{}
};
USTRUCT()
struct FGameplayDebuggerExtensionConfig
{
GENERATED_USTRUCT_BODY()
UPROPERTY(VisibleAnywhere, Category = Settings)
FString ExtensionName;
UPROPERTY(EditAnywhere, Category = Settings)
EGameplayDebuggerOverrideMode UseExtension;
UPROPERTY(EditAnywhere, Category = Settings, EditFixedSize)
TArray<FGameplayDebuggerInputConfig> InputHandlers;
FGameplayDebuggerExtensionConfig() : UseExtension(EGameplayDebuggerOverrideMode::UseDefault) {}
};
UCLASS(config = Engine, defaultconfig)
class GAMEPLAYDEBUGGER_API UGameplayDebuggerConfig : public UObject
{
GENERATED_UCLASS_BODY()
/** key used to activate visual debugger tool */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey ActivationKey;
/** select next category row */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategoryRowNextKey;
/** select previous category row */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategoryRowPrevKey;
/** select category slot 0 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot0;
/** select category slot 1 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot1;
/** select category slot 2 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot2;
/** select category slot 3 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot3;
/** select category slot 4 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot4;
/** select category slot 5 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot5;
/** select category slot 6 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot6;
/** select category slot 7 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot7;
/** select category slot 8 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot8;
/** select category slot 9 */
UPROPERTY(config, EditAnywhere, Category = Input)
FKey CategorySlot9;
/** additional canvas padding: left */
UPROPERTY(config, EditAnywhere, Category = Display)
float DebugCanvasPaddingLeft;
/** additional canvas padding: right */
UPROPERTY(config, EditAnywhere, Category = Display)
float DebugCanvasPaddingRight;
/** additional canvas padding: top */
UPROPERTY(config, EditAnywhere, Category = Display)
float DebugCanvasPaddingTop;
/** additional canvas padding: bottom */
UPROPERTY(config, EditAnywhere, Category = Display)
float DebugCanvasPaddingBottom;
/** enable text shadow by default */
UPROPERTY(config, EditAnywhere, Category = Display)
bool bDebugCanvasEnableTextShadow;
UPROPERTY(config, EditAnywhere, Category = AddOns, EditFixedSize)
TArray<FGameplayDebuggerCategoryConfig> Categories;
UPROPERTY(config, EditAnywhere, Category = AddOns, EditFixedSize)
TArray<FGameplayDebuggerExtensionConfig> Extensions;
/** updates entry in Categories array and modifies category creation params */
void UpdateCategoryConfig(const FName CategoryName, int32& SlotIdx, uint8& CategoryState);
/** updates entry in Categories array and modifies input binding params */
void UpdateCategoryInputConfig(const FName CategoryName, const FName InputName, FName& KeyName, FGameplayDebuggerInputModifier& KeyModifier);
/** updates entry in Extensions array and modifies extension creation params */
void UpdateExtensionConfig(const FName ExtensionName, uint8& UseExtension);
/** updates entry in Categories array and modifies input binding params */
void UpdateExtensionInputConfig(const FName ExtensionName, const FName InputName, FName& KeyName, FGameplayDebuggerInputModifier& KeyModifier);
/** remove all category and extension data from unknown sources (outdated entries) */
void RemoveUnknownConfigs();
virtual void Serialize(FArchive& Ar) override;
#if WITH_EDITOR
virtual void PostEditChangeChainProperty(struct FPropertyChangedChainEvent& PropertyChangedEvent) override;
#endif
private:
/** used for cleanup */
TArray<FName> KnownCategoryNames;
TArray<FName> KnownExtensionNames;
TMultiMap<FName, FName> KnownCategoryInputNames;
TMultiMap<FName, FName> KnownExtensionInputNames;
};
UCLASS(config = EditorPerProjectUserSettings, meta = (DisplayName = "Gameplay Debugger"))
class GAMEPLAYDEBUGGER_API UGameplayDebuggerUserSettings : public UDeveloperSettings
{
GENERATED_BODY()
protected:
virtual FName GetCategoryName() const override { return TEXT("Advanced"); }
public:
static int32 GetFontSize() { return GetDefault<UGameplayDebuggerUserSettings>()->FontSize; }
static void SetFontSize(const int32 InFontSize);
/** Controls whether GameplayDebugger will be available in pure editor mode.
* @Note that you need to reload the map for the changes to this property to take effect */
UPROPERTY(config, EditAnywhere, Category = GameplayDebugger)
uint32 bEnableGameplayDebuggerInEditor : 1;
/**
* Distance from view location under which actors can be selected
* This distance can also be used by some categories to apply culling.
*/
UPROPERTY(config, EditAnywhere, Category = GameplayDebugger)
float MaxViewDistance = 25000.0f;
/**
* Angle from view direction under which actors can be selected
* This angle can also be used by some categories to apply culling.
*/
UPROPERTY(config, EditAnywhere, Category = GameplayDebugger, meta = (UIMin = 0, ClampMin = 0, UIMax = 180, ClampMax = 180, Units = deg))
float MaxViewAngle = 45.f;
protected:
/** Font Size used by Gameplay Debugger */
UPROPERTY(config, EditAnywhere, Category = GameplayDebugger)
int32 FontSize = 10;
};