57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
|
|
|
|
|
#include "DataAssets/OLSExperienceActionSetDataAsset.h"
|
|
|
|
#if WITH_EDITOR
|
|
#include "Misc/DataValidation.h"
|
|
#endif
|
|
|
|
#include "GameFeatureAction.h"
|
|
|
|
#include UE_INLINE_GENERATED_CPP_BY_NAME(OLSExperienceActionSetDataAsset)
|
|
|
|
#define LOCTEXT_NAMESPACE "OLSSystem"
|
|
|
|
#if WITH_EDITOR
|
|
EDataValidationResult UOLSExperienceActionSetDataAsset::IsDataValid(FDataValidationContext& context) const
|
|
{
|
|
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
|
|
void UOLSExperienceActionSetDataAsset::UpdateAssetBundleData()
|
|
{
|
|
Super::UpdateAssetBundleData();
|
|
|
|
for (UGameFeatureAction* action : Actions)
|
|
{
|
|
if (action)
|
|
{
|
|
action->AddAdditionalAssetBundleData(AssetBundleData);
|
|
}
|
|
}
|
|
}
|
|
#endif // WITH_EDITORONLY_DATA
|
|
|
|
#undef LOCTEXT_NAMESPACE |