2019-12-26 15:32:37 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2015-07-06 14:49:51 -04:00
# pragma once
2022-07-20 12:03:45 -04:00
# include "Containers/Array.h"
2016-11-23 15:48:37 -05:00
# include "CoreMinimal.h"
2015-07-06 14:49:51 -04:00
# include "LocalizationTargetTypes.h"
2022-07-20 12:03:45 -04:00
# include "UObject/Object.h"
# include "UObject/ObjectMacros.h"
# include "UObject/ObjectPtr.h"
# include "UObject/UObjectGlobals.h"
2015-07-06 14:49:51 -04:00
# include "LocalizationSettings.generated.h"
2022-07-20 12:03:45 -04:00
class FString ;
2017-04-10 11:00:33 -04:00
class ULocalizationTargetSet ;
2022-07-20 12:03:45 -04:00
struct FPropertyChangedEvent ;
2016-11-23 15:48:37 -05:00
2015-07-06 14:49:51 -04:00
// Class for loading/saving configuration settings and the details view objects needed for localization dashboard functionality.
UCLASS ( Config = Editor , defaultconfig )
class LOCALIZATION_API ULocalizationSettings : public UObject
{
GENERATED_BODY ( )
public :
ULocalizationSettings ( const FObjectInitializer & ObjectInitializer ) ;
private :
UPROPERTY ( )
2021-01-27 17:40:25 -04:00
TObjectPtr < ULocalizationTargetSet > EngineTargetSet ;
2015-07-06 14:49:51 -04:00
UPROPERTY ( config )
TArray < FLocalizationTargetSettings > EngineTargetsSettings ;
UPROPERTY ( )
2021-01-27 17:40:25 -04:00
TObjectPtr < ULocalizationTargetSet > GameTargetSet ;
2015-07-06 14:49:51 -04:00
UPROPERTY ( config )
TArray < FLocalizationTargetSettings > GameTargetsSettings ;
public :
# if WITH_EDITOR
virtual void PostInitProperties ( ) override ;
virtual void PostEditChangeProperty ( FPropertyChangedEvent & PropertyChangedEvent ) override ;
# endif
static ULocalizationTargetSet * GetEngineTargetSet ( ) ;
static ULocalizationTargetSet * GetGameTargetSet ( ) ;
2016-03-13 18:53:13 -04:00
} ;
/** Struct containing util functions for getting/setting the SCC settings for the localization dashboard */
struct LOCALIZATION_API FLocalizationSourceControlSettings
{
public :
/** Checks to see whether source control is available based upon the current editor SCC settings. */
static bool IsSourceControlAvailable ( ) ;
/** Check to see whether we should use SCC when running the localization commandlets. This should be used to optionally pass "-EnableSCC" to the commandlet. */
static bool IsSourceControlEnabled ( ) ;
/** Check to see whether we should automatically submit changed files after running the commandlet. This should be used to optionally pass "-DisableSCCSubmit" to the commandlet. */
static bool IsSourceControlAutoSubmitEnabled ( ) ;
/** Set whether we should use SCC when running the localization commandlets. */
static void SetSourceControlEnabled ( const bool bIsEnabled ) ;
/** Set whether we should automatically submit changed files after running the commandlet. */
static void SetSourceControlAutoSubmitEnabled ( const bool bIsEnabled ) ;
private :
static const FString LocalizationSourceControlSettingsCategoryName ;
static const FString SourceControlEnabledSettingName ;
static const FString SourceControlAutoSubmitEnabledSettingName ;
} ;