RealtimeStyleTransferRuntime/Source/LyraGame/GameFeatures/GameFeatureAction_AddGamepl...

36 lines
1.2 KiB
C++
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "GameFeatureAction_AddGameplayCuePath.h"
#include "GameplayCueManager.h"
#include "AbilitySystemGlobals.h"
#define LOCTEXT_NAMESPACE "GameFeatures"
UGameFeatureAction_AddGameplayCuePath::UGameFeatureAction_AddGameplayCuePath()
{
// Add a default path that is commonly used
DirectoryPathsToAdd.Add(FDirectoryPath{ TEXT("/GameplayCues") });
}
#if WITH_EDITOR
EDataValidationResult UGameFeatureAction_AddGameplayCuePath::IsDataValid(TArray<FText>& ValidationErrors)
{
EDataValidationResult Result = Super::IsDataValid(ValidationErrors);
FText ErrorReason = FText::GetEmpty();
for (const FDirectoryPath& Directory : DirectoryPathsToAdd)
{
if (Directory.Path.IsEmpty())
{
const FText InvalidCuePathError = FText::Format(LOCTEXT("InvalidCuePathError", "'{0}' is not a valid path!"), FText::FromString(Directory.Path));
ValidationErrors.Emplace(InvalidCuePathError);
ValidationErrors.Emplace(ErrorReason);
Result = CombineDataValidationResults(Result, EDataValidationResult::Invalid);
}
}
return CombineDataValidationResults(Result, EDataValidationResult::Valid);
}
#endif // WITH_EDITOR
#undef LOCTEXT_NAMESPACE