Files
UnrealEngineUWP/Engine/Source/Developer/GameplayDebugger/Classes/GameplayDebuggerSettings.h
Andrew Rodham 8ff0d8b98b Added config migration path for newer versions of the engine.
Newly installed versions of the engine will now attempt to copy the project-agnostic config settings from a previous engine installation. This happens by way of a versioned manifest that copies old versions when the manifest does not exist, or is a different version. This code path is benign for non-installed versions of the engine (or FPaths::ShouldSaveToUserDir() is false).

EditorGameAgnosticSettings and EditorUserSettings ini paths have been renamed to EditorSettings and EditorPerProjectUserSettings respectively to better convey their purpose. In general, most settings should be saved in EditorSettings (project-agnostic) so that they apply regardless of which project is open. We have some way to go migrating existing settings for this to be the case, however.

Some previously per-project configuration files are now project-agnostic (such as Editor.ini, EditorKeyBindings.ini, and EditorLayout.ini)

GEditor->Access...Settings and GEditor->Get...Settings have been removed in favor of direct access of the CDO through GetMutableDefault<> and GetDefault<> respectively. Global config ini filenames that are not set up are now neither loaded nor saved on build machines, to handle the problem of indeterminate state more generically.

This addresses UETOOL-270 (Most editor preferences should be project-agnostic)

[CL 2517558 by Andrew Rodham in Main branch]
2015-04-20 10:12:55 -04:00

122 lines
4.4 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
GameplayDebuggerSettings.h: Declares the UGameplayDebuggerSettings class.
=============================================================================*/
#pragma once
#include "GameplayDebuggerSettings.generated.h"
#define ADD_LEVEL_EDITOR_EXTENSIONS 0
USTRUCT()
struct FGDTCustomViewNames
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, config, Category = "Settings")
FString GameView1;
UPROPERTY(EditAnywhere, config, Category = "Settings")
FString GameView2;
UPROPERTY(EditAnywhere, config, Category = "Settings")
FString GameView3;
UPROPERTY(EditAnywhere, config, Category = "Settings")
FString GameView4;
UPROPERTY(EditAnywhere, config, Category = "Settings")
FString GameView5;
};
UCLASS(config = EditorPerProjectUserSettings)
class GAMEPLAYDEBUGGER_API UGameplayDebuggerSettings : public UObject
{
GENERATED_UCLASS_BODY()
public:
#if WITH_EDITOR
// Begin UObject Interface
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
virtual void PostInitProperties() override;
// End UObject Interface
#endif
DECLARE_EVENT_OneParam(UGameplayDebuggerSettings, FSettingChangedEvent, FName /*PropertyName*/);
FSettingChangedEvent& OnSettingChanged() { return SettingChangedEvent; }
uint32 GetSettings()
{
uint32 Settings = 0;
Settings = OverHead ? Settings | (1 << EAIDebugDrawDataView::OverHead) : Settings & ~(1 << EAIDebugDrawDataView::OverHead);
Settings = Basic ? Settings | (1 << EAIDebugDrawDataView::Basic) : Settings & ~(1 << EAIDebugDrawDataView::Basic);
Settings = BehaviorTree ? Settings | (1 << EAIDebugDrawDataView::BehaviorTree) : Settings & ~(1 << EAIDebugDrawDataView::BehaviorTree);
Settings = EQS ? Settings | (1 << EAIDebugDrawDataView::EQS) : Settings & ~(1 << EAIDebugDrawDataView::EQS);
Settings = Perception ? Settings | (1 << EAIDebugDrawDataView::Perception) : Settings & ~(1 << EAIDebugDrawDataView::Perception);
Settings = GameView1 ? Settings | (1 << EAIDebugDrawDataView::GameView1) : Settings & ~(1 << EAIDebugDrawDataView::GameView1);
Settings = GameView2 ? Settings | (1 << EAIDebugDrawDataView::GameView2) : Settings & ~(1 << EAIDebugDrawDataView::GameView2);
Settings = GameView3 ? Settings | (1 << EAIDebugDrawDataView::GameView3) : Settings & ~(1 << EAIDebugDrawDataView::GameView3);
Settings = GameView4 ? Settings | (1 << EAIDebugDrawDataView::GameView4) : Settings & ~(1 << EAIDebugDrawDataView::GameView4);
Settings = GameView5 ? Settings | (1 << EAIDebugDrawDataView::GameView5) : Settings & ~(1 << EAIDebugDrawDataView::GameView5);
return Settings;
}
bool UseAlternateKeys() { return bUseAlternateKeys; }
const FGDTCustomViewNames& GetCustomViewNames() { return CustomViewNames; }
#if ADD_LEVEL_EDITOR_EXTENSIONS
/** Experimental setting to extend viewport menu in Simulate, to have quick access to GameplayDebugger settings. */
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool bExtendViewportMenu;
#endif
protected:
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
FGDTCustomViewNames CustomViewNames;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool OverHead;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool Basic;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool BehaviorTree;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger|EQS")
bool EQS;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger|EQS", meta = (EditCondition = "EQS"))
bool EnableEQSOnHUD;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger|EQS", meta = (EditCondition = "EQS"))
int32 ActiveEQSIndex;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool Perception;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool GameView1;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool GameView2;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool GameView3;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool GameView4;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool GameView5;
UPROPERTY(EditAnywhere, config, Category = "GameplayDebugger")
bool bUseAlternateKeys;
// Holds an event delegate that is executed when a setting has changed.
FSettingChangedEvent SettingChangedEvent;
};