OLS/Source/ols/Private/DataAssets/OLSExperienceActionSetDataAsset.cpp

57 lines
1.4 KiB
C++
Raw Normal View History

2025-01-09 18:27:12 +00:00
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
2025-01-09 23:05:57 +00:00
#include "DataAssets/OLSExperienceActionSetDataAsset.h"
2025-01-09 18:27:12 +00:00
#if WITH_EDITOR
#include "Misc/DataValidation.h"
#endif
#include "GameFeatureAction.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(OLSExperienceActionSet)
#define LOCTEXT_NAMESPACE "OLSSystem"
#if WITH_EDITOR
2025-01-09 23:05:57 +00:00
EDataValidationResult UOLSExperienceActionSetDataAsset::IsDataValid(FDataValidationContext& context) const
2025-01-09 18:27:12 +00:00
{
EDataValidationResult result = CombineDataValidationResults(Super::IsDataValid(context), EDataValidationResult::Valid);
int32 entryIndex = 0;
for (const UGameFeatureAction* action : Actions)
{
if (action)
{
EDataValidationResult ChildResult = action->IsDataValid(context);
result = CombineDataValidationResults(result, ChildResult);
}
else
{
result = EDataValidationResult::Invalid;
context.AddError(FText::Format(LOCTEXT("ActionEntryIsNull", "Null entry at index {0} in Actions"), FText::AsNumber(entryIndex)));
}
++entryIndex;
}
return result;
}
#endif
#if WITH_EDITORONLY_DATA
2025-01-09 23:05:57 +00:00
void UOLSExperienceActionSetDataAsset::UpdateAssetBundleData()
2025-01-09 18:27:12 +00:00
{
Super::UpdateAssetBundleData();
for (UGameFeatureAction* action : Actions)
{
if (action)
{
action->AddAdditionalAssetBundleData(AssetBundleData);
}
}
}
#endif // WITH_EDITORONLY_DATA
#undef LOCTEXT_NAMESPACE