2019-12-26 15:32:37 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2015-07-06 14:49:51 -04:00
|
|
|
|
|
|
|
|
#include "LocalizationSettings.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 "Misc/ConfigCacheIni.h"
|
|
|
|
|
#include "ISourceControlProvider.h"
|
2015-07-06 14:49:51 -04:00
|
|
|
#include "ISourceControlModule.h"
|
|
|
|
|
|
2022-09-24 13:31:25 -04:00
|
|
|
#include UE_INLINE_GENERATED_CPP_BY_NAME(LocalizationSettings)
|
|
|
|
|
|
2015-07-06 14:49:51 -04:00
|
|
|
ULocalizationSettings::ULocalizationSettings(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
: Super(ObjectInitializer)
|
|
|
|
|
, EngineTargetSet(ObjectInitializer.CreateDefaultSubobject<ULocalizationTargetSet>(this, TEXT("EngineLocalizationTargetSet")))
|
|
|
|
|
, GameTargetSet(ObjectInitializer.CreateDefaultSubobject<ULocalizationTargetSet>(this, TEXT("ProjectLocalizationTargetSet")))
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if WITH_EDITOR
|
|
|
|
|
void ULocalizationSettings::PostInitProperties()
|
|
|
|
|
{
|
|
|
|
|
Super::PostInitProperties();
|
|
|
|
|
|
|
|
|
|
// Create and initialize objects for details model from backing config properties.
|
|
|
|
|
if (EngineTargetSet)
|
|
|
|
|
{
|
|
|
|
|
EngineTargetSet->TargetObjects.Empty(EngineTargetsSettings.Num());
|
|
|
|
|
for (const auto& TargetSettings : EngineTargetsSettings)
|
|
|
|
|
{
|
|
|
|
|
ULocalizationTarget* const TargetObject = NewObject<ULocalizationTarget>(EngineTargetSet);
|
|
|
|
|
TargetObject->Settings = TargetSettings;
|
|
|
|
|
TargetObject->UpdateStatusFromConflictReport();
|
|
|
|
|
TargetObject->UpdateWordCountsFromCSV();
|
|
|
|
|
EngineTargetSet->TargetObjects.Add(TargetObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create and initialize objects for details model from backing config properties.
|
|
|
|
|
if (GameTargetSet)
|
|
|
|
|
{
|
|
|
|
|
GameTargetSet->TargetObjects.Empty(EngineTargetsSettings.Num());
|
|
|
|
|
for (const auto& TargetSettings : GameTargetsSettings)
|
|
|
|
|
{
|
|
|
|
|
ULocalizationTarget* const TargetObject = NewObject<ULocalizationTarget>(GameTargetSet);
|
|
|
|
|
TargetObject->Settings = TargetSettings;
|
|
|
|
|
TargetObject->UpdateStatusFromConflictReport();
|
|
|
|
|
TargetObject->UpdateWordCountsFromCSV();
|
|
|
|
|
GameTargetSet->TargetObjects.Add(TargetObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ULocalizationSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
|
|
|
|
|
{
|
|
|
|
|
Super::PostEditChangeProperty(PropertyChangedEvent);
|
|
|
|
|
|
|
|
|
|
// Copy settings back.
|
|
|
|
|
if (EngineTargetSet)
|
|
|
|
|
{
|
|
|
|
|
EngineTargetsSettings.Empty(EngineTargetSet->TargetObjects.Num());
|
|
|
|
|
for (const auto& TargetObject : EngineTargetSet->TargetObjects)
|
|
|
|
|
{
|
|
|
|
|
EngineTargetsSettings.Add(TargetObject ? TargetObject->Settings : FLocalizationTargetSettings());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Copy settings back.
|
|
|
|
|
if (GameTargetSet)
|
|
|
|
|
{
|
|
|
|
|
GameTargetsSettings.Empty(GameTargetSet->TargetObjects.Num());
|
|
|
|
|
for (const auto& TargetObject : GameTargetSet->TargetObjects)
|
|
|
|
|
{
|
|
|
|
|
GameTargetsSettings.Add(TargetObject ? TargetObject->Settings : FLocalizationTargetSettings());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-27 15:14:40 -04:00
|
|
|
TryUpdateDefaultConfigFile();
|
2015-07-06 14:49:51 -04:00
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
ULocalizationTargetSet* ULocalizationSettings::GetEngineTargetSet()
|
|
|
|
|
{
|
|
|
|
|
ULocalizationSettings* LocalizationSettings = GetMutableDefault<ULocalizationSettings>();
|
|
|
|
|
check(LocalizationSettings);
|
|
|
|
|
return LocalizationSettings->EngineTargetSet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ULocalizationTargetSet* ULocalizationSettings::GetGameTargetSet()
|
|
|
|
|
{
|
|
|
|
|
ULocalizationSettings* LocalizationSettings = GetMutableDefault<ULocalizationSettings>();
|
|
|
|
|
check(LocalizationSettings);
|
|
|
|
|
return LocalizationSettings->GameTargetSet;
|
Copying //UE4/Orion-Staging to //UE4/Main (Origin: //Orion/Dev-General @ 2904087)
==========================
MAJOR FEATURES + CHANGES
==========================
#lockdown Nick.Penwarden
Change 2903938 on 2016/03/10 by Frank.Gigliotti
Added an instance ID to FAnimMontageInstance
#CodeReview Laurent.Delayen
#RB Laurent.Delayen
#Tests PIE
Change 2903745 on 2016/03/10 by Wes.Hunt
Update Oodle TPS
#rb none
#tests none
#codereview:john.pollard
Change 2903689 on 2016/03/10 by Uriel.Doyon
New "LogHeroMaterials" console command, displaying the current state of materials and textures on the character hero.
#rb marcus.wasmer
#codereview marcus.wassmer
#tests editor, playing PC games, trying the new command
Change 2903669 on 2016/03/10 by Aaron.McLeran
OR-17180 Make stat soundcues and stat soundwaves NOT display zero volume sounds
- Change only effects debug stat commands for audio guys
#rb none
#tests played paragon with new debug stat commands, confirms doesn't show zero-volume sounds
Change 2903625 on 2016/03/10 by John.Pollard
XB1 Oodle SDK
#rb none
#tests none
#codereview Jeff.Campeau
Change 2903577 on 2016/03/10 by Ben.Marsh
Remaking latest build scripts from //UE4/Main @ 2900980.
Change 2903560 on 2016/03/10 by Ben.Marsh
Initial version of BuildGraph scripts - used to create build processes in UE4 which can be run locally or in parallel across a build farm (assuming synchronization and resource allocation implemented by a separate system). Intended to supersede GUBP.
Build graphs are declared using an XML script using syntax similar to MSBuild, ANT or NAnt, and consist of the following components:
* Tasks: Building blocks which can be executed as part of the build process. Many predefined tasks are provided (<Cook>, <Compile>, <Copy>, <Stage>, <Log>, <PakFile>, etc...), and additional tasks may be added be declaring classes derived from AutomationTool.CustomTask in other UAT modules.
* Nodes: A named sequence of tasks which is executed to produce outputs. Nodes may have input dependencies on other nodes before they can be executed. Declared with the <Node> element in scripts.
* Agent Groups: A set of nodes nodes which is executed on the same machine if running as part of a build system. Has no effect when building locally. Declared with the <Group> element in scripts.
* Triggers: Container for groups which should only be executed when explicitly triggered (using the -Trigger=<Name> or -SkipTriggers command line argument). Declared with the <Trigger> element in scripts.
* Notifiers: Specifies email recipients for failures in one or more nodes, whether they should receive notifications on warnings, and so on.
Properties can be passed in to a script on the command line, or set procedurally with the <Property Name="Foo" Value="Bar"/> syntax. Properties referenced with the $(Property Name) notation are valid within all strings, and will be expanded as macros when the script is read. If a property name is not set explicitly, it defaults to the contents of an environment variable with the same name.
Local properties, which only affect the scope of the containing XML element (node, group, etc...) are declared with the <Local Name="Foo" Value="Bar"/> element, and will override a similarly named global property for the local property's scope.
Any elements can be conditionally defined via the "If" attribute, and are largely identical to MSBuild conditions. Literals in conditions may be quoted with single (') or double (") quotes, or an unquoted sequence of letters, digits and underscore characters. All literals are considered identical regardless of how they are declared, and are considered case-insensitive for comparisons (so true equals 'True', equals "TRUE"). Available operators are "==", "!=", "And", "Or", "!", "(...)", "Exists(...)" and "HasTrailingSlash(...)". A full grammar is written up in Condition.cs.
File manipulation is done using wildcards and tags. Any attribute that accepts a list of files may consist of: a Perforce-style wildcard (matching any number of "...", "*" and "?" patterns in any location), a full path name, or a reference to a tagged collection of files, denoted by prefixing with a '#' character. Files may be added to a tag set using the <Tag> Task, which also allows performing set union/difference style operations. Each node can declare multiple outputs in the form of a list of named tags, which other nodes can then depend on.
Build graphs may be executed in parallel as part build system. To do so, the initial graph configuration is generated by running with the -Export=<Filename> argument (producing a JSON file listing the nodes and dependencies to execute). Each participating agent should be synced to the same changelist, and UAT should be re-run with the appropriate -Node=<Name> argument. Outputs from different nodes are transferred between agents via shared storage, typically a network share, the path to which can be specified on the command line using the -SharedStorageDir=<Path> argument. Note that the allocation of machines, and coordination between them, is assumed to be managed by an external system.
A schema for the known set of tasks can be generated by running UAT with the "-Schema=<FileName>" option. Generating a schema and referencing it from a BuildGraph script allows Visual Studio to validate and auto-complete elements as you type.
#rb none
#codereview Marc.Audy, Wes.Hunt, Matthew.Griffin, Richard.Fawcett
#tests local only so far, but not part of any build process yet
Change 2903539 on 2016/03/10 by John.Pollard
Improve replay playback debugging of character movement
#rb none
#tests replays
Change 2903526 on 2016/03/10 by Ben.Marsh
Remake changes from //UE4/Main without integration history, to add support for BuildGraph tasks.
#rb none
#tests none
Change 2903512 on 2016/03/10 by Dan.Youhon
Modify minimum Duration values for JumpForce and MoveToForce ability tasks so that having minimum Duration values doesn't trigger check()s
#rb None
#tests Compiles
Change 2903474 on 2016/03/10 by Marc.Audy
Fix crash if ChildActor is null
#rb None
#tests None
Change 2903314 on 2016/03/10 by Marc.Audy
Fix ParentComponent not being persisted and fixup content that was saved in the window it was broken
#rb James.Golding
#tests Selection of child actors works as expected
#jira UE-28201
Change 2903298 on 2016/03/10 by Simon.Tovey
Disabling the trails optimization.
#tests none
#rb none
#codereview Olaf.Piesche
Change 2903124 on 2016/03/10 by Robert.Manuszewski
Small refactor to pak signing to help with exe protection
#rb none
#tests none
[CL 2907678 by Andrew Grant in Main branch]
2016-03-13 18:53:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const FString FLocalizationSourceControlSettings::LocalizationSourceControlSettingsCategoryName = TEXT("LocalizationSourceControlSettings");
|
|
|
|
|
const FString FLocalizationSourceControlSettings::SourceControlEnabledSettingName = TEXT("SourceControlEnabled");
|
|
|
|
|
const FString FLocalizationSourceControlSettings::SourceControlAutoSubmitEnabledSettingName = TEXT("SourceControlAutoSubmitEnabled");
|
|
|
|
|
|
|
|
|
|
bool FLocalizationSourceControlSettings::IsSourceControlAvailable()
|
|
|
|
|
{
|
|
|
|
|
ISourceControlModule& SourceControlModule = ISourceControlModule::Get();
|
|
|
|
|
return SourceControlModule.IsEnabled() && SourceControlModule.GetProvider().IsAvailable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FLocalizationSourceControlSettings::IsSourceControlEnabled()
|
|
|
|
|
{
|
|
|
|
|
if (!IsSourceControlAvailable())
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool bIsEnabled = true;
|
|
|
|
|
if (!GConfig->GetBool(*LocalizationSourceControlSettingsCategoryName, *SourceControlEnabledSettingName, bIsEnabled, GEditorPerProjectIni))
|
|
|
|
|
{
|
|
|
|
|
bIsEnabled = true;
|
|
|
|
|
}
|
|
|
|
|
return bIsEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FLocalizationSourceControlSettings::IsSourceControlAutoSubmitEnabled()
|
|
|
|
|
{
|
|
|
|
|
if (!IsSourceControlAvailable())
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool bIsEnabled = false;
|
|
|
|
|
if (!GConfig->GetBool(*LocalizationSourceControlSettingsCategoryName, *SourceControlAutoSubmitEnabledSettingName, bIsEnabled, GEditorPerProjectIni))
|
|
|
|
|
{
|
|
|
|
|
bIsEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
return bIsEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FLocalizationSourceControlSettings::SetSourceControlEnabled(const bool bIsEnabled)
|
|
|
|
|
{
|
|
|
|
|
GConfig->SetBool(*LocalizationSourceControlSettingsCategoryName, *SourceControlEnabledSettingName, bIsEnabled, GEditorPerProjectIni);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FLocalizationSourceControlSettings::SetSourceControlAutoSubmitEnabled(const bool bIsEnabled)
|
|
|
|
|
{
|
|
|
|
|
GConfig->SetBool(*LocalizationSourceControlSettingsCategoryName, *SourceControlAutoSubmitEnabledSettingName, bIsEnabled, GEditorPerProjectIni);
|
|
|
|
|
}
|
2022-09-24 13:31:25 -04:00
|
|
|
|