Compare commits

..

No commits in common. "01eda48d3877a598057739124bbef32c841b47be" and "49843cdecf7213cbf66c67593b7b65f1b7ec9ea2" have entirely different histories.

4 changed files with 12 additions and 112 deletions

View File

@ -1,57 +0,0 @@
// © 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/OLSExperienceActionSet.h"
#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
EDataValidationResult UOLSExperienceActionSet::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 UOLSExperienceActionSet::UpdateAssetBundleData()
{
Super::UpdateAssetBundleData();
for (UGameFeatureAction* action : Actions)
{
if (action)
{
action->AddAdditionalAssetBundleData(AssetBundleData);
}
}
}
#endif // WITH_EDITORONLY_DATA
#undef LOCTEXT_NAMESPACE

View File

@ -9,7 +9,6 @@
#include "GameFeatureAction.h"
#include "GameFeaturesSubsystemSettings.h"
#include "TimerManager.h"
#include "DataAssets/OLSExperienceActionSet.h"
#include "DataAssets/OLSExperienceDefinitionPrimaryDataAsset.h"
#include "Net/UnrealNetwork.h"
#include "Systems/OLSAssetManager.h"
@ -225,14 +224,14 @@ void UOLSExperienceManagerComponent::StartExperienceLoad()
TSet<FSoftObjectPath> rawAssetList;
bundleAssetList.Add(CurrentExperience->GetPrimaryAssetId());
for (const TObjectPtr<UOLSExperienceActionSet>& actionSet : CurrentExperience->ActionSets)
{
if (actionSet != nullptr)
{
bundleAssetList.Add(actionSet->GetPrimaryAssetId());
}
}
// @Todo implement this
// for (const TObjectPtr<ULyraExperienceActionSet>& ActionSet : CurrentExperience->ActionSets)
// {
// if (ActionSet != nullptr)
// {
// BundleAssetList.Add(ActionSet->GetPrimaryAssetId());
// }
// }
// Load assets associated with the experience

View File

@ -1,42 +0,0 @@
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
#pragma once
#include "CoreMinimal.h"
#include "OLSPawnPrimaryDataAsset.h"
#include "OLSExperienceActionSet.generated.h"
/**
* Definition of a set of actions to perform as part of entering an experience
*/
UCLASS(BlueprintType, NotBlueprintable)
class OLS_API UOLSExperienceActionSet : public UOLSPawnPrimaryDataAsset
{
GENERATED_BODY()
public:
//~ Begin UObject interface
#if WITH_EDITOR
virtual EDataValidationResult IsDataValid(class FDataValidationContext& context) const override;
#endif
//~ End UObject interface
//~ Begin UPrimaryDataAsset interface
#if WITH_EDITORONLY_DATA
virtual void UpdateAssetBundleData() override;
#endif
//~ End UPrimaryDataAsset interface
public:
// List of actions to perform as this experience is loaded/activated/deactivated/unloaded
UPROPERTY(EditAnywhere, Instanced, Category="Actions to Perform")
TArray<TObjectPtr<class UGameFeatureAction>> Actions;
// List of Game Feature Plugins this experience wants to have active
UPROPERTY(EditAnywhere, Category="Feature Dependencies")
TArray<FString> GameFeaturesToEnable;
};

View File

@ -42,14 +42,14 @@ public:
TArray<FString> GameFeaturesToEnable;
/** The default pawn class to spawn for players */
UPROPERTY(EditDefaultsOnly, Category = "OLSExperienceDefinition")
TObjectPtr<const class UOLSPawnPrimaryDataAsset> DefaultPawnData = nullptr;
// UPROPERTY(EditDefaultsOnly, Category = "OLSExperienceDefinition")
// TObjectPtr<const ULyraPawnData> DefaultPawnData;
// List of actions to perform as this experience is loaded/activated/deactivated/unloaded
UPROPERTY(EditDefaultsOnly, Instanced, Category = "OLSExperienceDefinition")
TArray<TObjectPtr<class UGameFeatureAction>> Actions;
// List of additional action sets to compose into this experience
UPROPERTY(EditDefaultsOnly, Category = "OLSExperienceDefinition")
TArray<TObjectPtr<class UOLSExperienceActionSet>> ActionSets;
// UPROPERTY(EditDefaultsOnly, Category = "OLSExperienceDefinition")
// TArray<TObjectPtr<class ULyraExperienceActionSet>> ActionSets;
};