2025-01-06 21:29:37 +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/OLSExperienceDefinitionDataAsset.h"
2025-01-06 21:29:37 +00:00
# include "GameFeatureAction.h"
# if WITH_EDITOR
# include "Misc/DataValidation.h"
# endif
# include UE_INLINE_GENERATED_CPP_BY_NAME(OLSExperienceDefinitionPrimaryDataAsset)
# define LOCTEXT_NAMESPACE "OLSSystem"
2025-01-09 23:05:57 +00:00
UOLSExperienceDefinitionDataAsset : : UOLSExperienceDefinitionDataAsset ( )
2025-01-06 21:29:37 +00:00
{
}
# if WITH_EDITOR
2025-01-09 23:05:57 +00:00
EDataValidationResult UOLSExperienceDefinitionDataAsset : : IsDataValid ( FDataValidationContext & context ) const
2025-01-06 21:29:37 +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 ;
}
// Make sure users didn't subclass from a BP of this (it's fine and expected to subclass once in BP, just not twice)
if ( ! GetClass ( ) - > IsNative ( ) )
{
const UClass * parentClass = GetClass ( ) - > GetSuperClass ( ) ;
// Find the native parent
const UClass * firstNativeParent = parentClass ;
while ( ( firstNativeParent ! = nullptr ) & & ! firstNativeParent - > IsNative ( ) )
{
firstNativeParent = firstNativeParent - > GetSuperClass ( ) ;
}
if ( firstNativeParent ! = parentClass )
{
context . AddError ( FText : : Format ( LOCTEXT ( " ExperienceInheritenceIsUnsupported " , " Blueprint subclasses of Blueprint experiences is not currently supported (use composition via ActionSets instead). Parent class was {0} but should be {1}. " ) ,
FText : : AsCultureInvariant ( GetPathNameSafe ( parentClass ) ) ,
FText : : AsCultureInvariant ( GetPathNameSafe ( firstNativeParent ) )
) ) ;
result = EDataValidationResult : : Invalid ;
}
}
return result ;
}
# endif
2025-01-09 23:05:57 +00:00
FString UOLSExperienceDefinitionDataAsset : : GetIdentifierString ( ) const
2025-01-06 21:29:37 +00:00
{
return GetPrimaryAssetId ( ) . ToString ( ) ;
}
# if WITH_EDITOR
2025-01-09 23:05:57 +00:00
void UOLSExperienceDefinitionDataAsset : : UpdateAssetBundleData ( )
2025-01-06 21:29:37 +00:00
{
Super : : UpdateAssetBundleData ( ) ;
for ( UGameFeatureAction * action : Actions )
{
if ( action )
{
action - > AddAdditionalAssetBundleData ( AssetBundleData ) ;
}
}
}
# endif