RealtimeStyleTransferRuntime/Source/LyraGame/Hotfix/LyraTextHotfixConfig.h

38 lines
988 B
C
Raw Permalink Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "Internationalization/PolyglotTextData.h"
#include "LyraTextHotfixConfig.generated.h"
/**
* This class allows hotfixing individual FText values anywhere
*/
UCLASS(config=Game, defaultconfig)
class ULyraTextHotfixConfig : public UDeveloperSettings
{
GENERATED_BODY()
public:
ULyraTextHotfixConfig(const FObjectInitializer& ObjectInitializer);
// UObject interface
virtual void PostInitProperties() override;
virtual void PostReloadConfig(FProperty* PropertyThatWasLoaded) override;
#if WITH_EDITOR
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
#endif
// End of UObject interface
private:
void ApplyTextReplacements() const;
private:
// The list of FText values to hotfix
UPROPERTY(Config, EditAnywhere)
TArray<FPolyglotTextData> TextReplacements;
};