2019-12-26 15:33:43 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2015-04-22 13:40:06 -04:00
|
|
|
|
|
|
|
|
#include "SConfigEditor.h"
|
2022-08-24 22:45:13 -04:00
|
|
|
|
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
|
|
|
#include "ConfigPropertyHelper.h"
|
2022-08-24 22:45:13 -04:00
|
|
|
#include "Containers/Array.h"
|
|
|
|
|
#include "Containers/Map.h"
|
|
|
|
|
#include "Containers/UnrealString.h"
|
|
|
|
|
#include "DetailsViewArgs.h"
|
|
|
|
|
#include "HAL/Platform.h"
|
|
|
|
|
#include "HAL/PlatformCrt.h"
|
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
|
|
|
#include "IDetailsView.h"
|
2022-08-24 22:45:13 -04:00
|
|
|
#include "Layout/Children.h"
|
|
|
|
|
#include "Misc/ConfigCacheIni.h"
|
|
|
|
|
#include "Misc/ConfigTypes.h"
|
|
|
|
|
#include "Modules/ModuleManager.h"
|
2015-04-22 13:40:06 -04:00
|
|
|
#include "PropertyEditorModule.h"
|
|
|
|
|
#include "STargetPlatformSelector.h"
|
2022-08-24 22:45:13 -04:00
|
|
|
#include "SlateOptMacros.h"
|
|
|
|
|
#include "SlotBase.h"
|
|
|
|
|
#include "Templates/Tuple.h"
|
|
|
|
|
#include "UObject/Class.h"
|
|
|
|
|
#include "UObject/FieldPath.h"
|
|
|
|
|
#include "UObject/NameTypes.h"
|
|
|
|
|
#include "UObject/ObjectPtr.h"
|
|
|
|
|
#include "UObject/Package.h"
|
|
|
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
|
#include "UObject/UnrealType.h"
|
|
|
|
|
#include "Widgets/SBoxPanel.h"
|
2015-04-22 13:40:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "ConfigEditor"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
2019-12-13 11:07:03 -05:00
|
|
|
void SConfigEditor::Construct(const FArguments& InArgs, TWeakFieldPtr<FProperty> InEditProperty)
|
2015-04-22 13:40:06 -04:00
|
|
|
{
|
|
|
|
|
TargetPlatformSelection = SNew(STargetPlatformSelector)
|
|
|
|
|
.OnTargetPlatformChanged(this, &SConfigEditor::HandleTargetPlatformChanged);
|
|
|
|
|
|
|
|
|
|
EditProperty = InEditProperty;
|
|
|
|
|
|
|
|
|
|
LocalConfigCache = MakeShareable(new FConfigCacheIni(EConfigCacheType::Temporary));
|
|
|
|
|
|
|
|
|
|
// initialize details view
|
|
|
|
|
FDetailsViewArgs DetailsViewArgs;
|
|
|
|
|
{
|
|
|
|
|
DetailsViewArgs.bAllowSearch = false;
|
|
|
|
|
DetailsViewArgs.bHideSelectionTip = true;
|
|
|
|
|
DetailsViewArgs.bLockable = false;
|
|
|
|
|
DetailsViewArgs.bSearchInitialKeyFocus = true;
|
|
|
|
|
DetailsViewArgs.bUpdatesFromSelection = false;
|
|
|
|
|
DetailsViewArgs.bShowOptions = false;
|
|
|
|
|
DetailsViewArgs.bShowModifiedPropertiesOption = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DetailsView = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor").CreateDetailView(DetailsViewArgs);
|
|
|
|
|
|
|
|
|
|
CreateDisplayObjectForSelectedTargetPlatform();
|
|
|
|
|
|
|
|
|
|
////
|
|
|
|
|
// Our Widget setup is complete.
|
|
|
|
|
PropertyValueEditor = DetailsView.ToSharedRef();
|
|
|
|
|
|
|
|
|
|
ChildSlot
|
|
|
|
|
[
|
|
|
|
|
SNew(SVerticalBox)
|
|
|
|
|
+ SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
TargetPlatformSelection.ToSharedRef()
|
|
|
|
|
]
|
|
|
|
|
+ SVerticalBox::Slot()
|
|
|
|
|
[
|
|
|
|
|
PropertyValueEditor.ToSharedRef()
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
|
|
|
|
|
|
|
|
|
void SConfigEditor::CreateDisplayObjectForSelectedTargetPlatform()
|
|
|
|
|
{
|
|
|
|
|
// Get the ini file and hierarchy linked with this property
|
|
|
|
|
FString SelectedTargetPlatform = *TargetPlatformSelection->GetSelectedTargetPlatform().Get();
|
|
|
|
|
|
|
|
|
|
FString ConfigHelperName(TEXT("ConfigEditorPropertyHelper_"));
|
|
|
|
|
ConfigHelperName += SelectedTargetPlatform;
|
|
|
|
|
|
|
|
|
|
PropHelper = FindObject<UConfigHierarchyPropertyView>(GetTransientPackage(), *ConfigHelperName);
|
|
|
|
|
if (!PropHelper.IsValid())
|
|
|
|
|
{
|
|
|
|
|
PropHelper = NewObject<UConfigHierarchyPropertyView>(GetTransientPackage(), *ConfigHelperName);
|
|
|
|
|
PropHelper->AddToRoot();
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 11:07:03 -05:00
|
|
|
PropHelper->EditProperty = EditProperty.Get();
|
2015-04-22 13:40:06 -04:00
|
|
|
FString ClassConfigName = PropHelper->EditProperty->GetOwnerClass()->ClassConfigName.ToString();
|
|
|
|
|
|
|
|
|
|
FConfigFile PlatformIniFile;
|
|
|
|
|
LocalConfigCache->LoadLocalIniFile(PlatformIniFile, *ClassConfigName, true, *SelectedTargetPlatform);
|
|
|
|
|
|
Fixed the warning that caused the original backout
[Backout] - CL31459949
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL31443953
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
Phase 1 of the FConfigBranch changes:
Introduced FConfigBranch which maintains logic and data for each individual branch of GConfig (Engine, Game, Input, DeviceProfiles, etc), with static and dynamic layers
Introduced FConfigCommandStream which is how each layer is loaded, and Apply'd to an FConfigFile
Added a new way of making a "diff" of in-memory vs what's loaded, which creates an FConfigCommandStream that can be re-applied (more useful in Phase 2, see below)
Expectation is no visible differences from before this change, as it's mostly internal data structure changes
Phase 2 is where the functional changes will happen, with the dynamic layers being able to be removed at runtime, and the state of GConfig is maintained as expdected
The editor does maintain full state of where config values come from, so the "getini" command in the editor will show a lot more information now
Runtime will not keep any state, so unloading dynamic layers is not supported by default (running with -ConfigReplayMethod=1 or 2 will allow for it, but will use more memory)
#rb david.harvey
#jira UE-201472
[CL 31470013 by josh adams in ue5-main branch]
2024-02-14 08:59:25 -05:00
|
|
|
for (const auto& IniFile : PlatformIniFile.Branch->Hierarchy)
|
2015-04-22 13:40:06 -04:00
|
|
|
{
|
2022-07-07 01:55:35 -04:00
|
|
|
UPropertyConfigFileDisplayRow* ConfigFilePropertyObj = NewObject<UPropertyConfigFileDisplayRow>(GetTransientPackage(), *IniFile.Value);
|
|
|
|
|
ConfigFilePropertyObj->InitWithConfigAndProperty(IniFile.Value, PropHelper->EditProperty.Get());
|
2015-04-22 13:40:06 -04:00
|
|
|
|
|
|
|
|
PropHelper->ConfigFilePropertyObjects.Add(ConfigFilePropertyObj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DetailsView->SetObject(PropHelper.Get());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SConfigEditor::HandleTargetPlatformChanged()
|
|
|
|
|
{
|
|
|
|
|
CreateDisplayObjectForSelectedTargetPlatform();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|