Files
UnrealEngineUWP/Engine/Source/Developer/GameplayDebugger/Public/GameplayDebuggerConfig.h
bryan sefcik de1956f47b Ran IWYU on Public headers under Engine/Source/Developer/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21064294 by bryan.sefcik
#jira
#preflight 62d5c2111062f2e63015e598

#ROBOMERGE-OWNER: bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21155249 via CL 21158121 via CL 21161259
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21182053 by bryan sefcik in ue5-main branch]
2022-07-20 12:03:45 -04:00

260 lines
7.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/Array.h"
#include "Containers/Map.h"
#include "Containers/UnrealString.h"
#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "HAL/Platform.h"
#include "InputCoreTypes.h"
#include "UObject/NameTypes.h"
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "UObject/UObjectGlobals.h"
#include "GameplayDebuggerConfig.generated.h"
class FArchive;
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;
};