Files
UnrealEngineUWP/Engine/Source/Developer/SourceControl/Private/SourceControlPreferences.cpp
eric boucher ef71ea2b5b New localization option to move localized variants alongside source asset in the content browser and another one to detect if those localized variants are only in Revision Control:
- Project Settings / Editor / Assets / Internationalization / Rename Localized Variants Alongside Source Asset (defaults to: true)
 - Project Settings / Editor / Revision Control / Internationalization / Requires Revision Control to Rename Localizable Assets (defaults to: false) (works only with Perforce)

#jira UE-216348
#rb Jamie.Dale, wouter.burgers
[RN]

[CL 35804579 by eric boucher in ue5-main branch]
2024-08-26 14:02:18 -04:00

39 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "SourceControlPreferences.h"
#include "ISourceControlModule.h"
#include "ISourceControlProvider.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(SourceControlPreferences)
bool USourceControlPreferences::IsValidationTagEnabled()
{
return GetDefault<USourceControlPreferences>()->bEnableValidationTag;
}
bool USourceControlPreferences::ShouldDeleteNewFilesOnRevert()
{
return GetDefault<USourceControlPreferences>()->bShouldDeleteNewFilesOnRevert;
}
bool USourceControlPreferences::AreUncontrolledChangelistsEnabled()
{
return GetDefault<USourceControlPreferences>()->bEnableUncontrolledChangelists;
}
bool USourceControlPreferences::RequiresRevisionControlToRenameLocalizableAssets()
{
// This feature only works for Perforce (assume it is Perforce until Revision Control is configured)
bool bRevisionControlIsPerforce = true;
ISourceControlModule& SCModule = ISourceControlModule::Get();
if (SCModule.IsEnabled())
{
ISourceControlProvider& SCProvider = SCModule.GetProvider();
bRevisionControlIsPerforce = SCProvider.GetName() == "Perforce";
}
return bRevisionControlIsPerforce && GetDefault<USourceControlPreferences>()->bRequiresRevisionControlToRenameLocalizableAssets;
}