lyra_game_ue/Source/LyraGame/Hotfix/LyraTextHotfixConfig.cpp

39 lines
996 B
C++
Raw Normal View History

2025-03-20 11:06:26 +01:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "LyraTextHotfixConfig.h"
#include "Internationalization/PolyglotTextData.h"
#include "Internationalization/TextLocalizationManager.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraTextHotfixConfig)
ULyraTextHotfixConfig::ULyraTextHotfixConfig(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void ULyraTextHotfixConfig::ApplyTextReplacements() const
{
FTextLocalizationManager::Get().RegisterPolyglotTextData(TextReplacements);
}
void ULyraTextHotfixConfig::PostInitProperties()
{
Super::PostInitProperties();
ApplyTextReplacements();
}
void ULyraTextHotfixConfig::PostReloadConfig(FProperty* PropertyThatWasLoaded)
{
Super::PostReloadConfig(PropertyThatWasLoaded);
ApplyTextReplacements();
}
#if WITH_EDITOR
void ULyraTextHotfixConfig::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
Super::PostEditChangeProperty(PropertyChangedEvent);
ApplyTextReplacements();
}
#endif