Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/Blueprint/StateTreeConditionBlueprintBase.h
mikko mononen 6a8caf79a7 StateTree UI improvements
- fixed description display on BP conditions
- added class cache that contains also BP classes and is kept up to date as the assets and BPs change
- the condition/evaluator/task selector now shows struct and class based items in same menu
- added meta = (Hidden) support for structs to prevent them displaying in the item selector

#jira UE-135723
#review-18322707
#robomerge 5.0
#preflight 61a7302e9c77d6100788c8ad

[CL 18336889 by mikko mononen in ue5-main branch]
2021-12-01 03:41:24 -05:00

52 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Templates/SubclassOf.h"
#include "StateTreeTypes.h"
#include "StateTreeConditionBase.h"
#include "StateTreePropertyBindings.h"
#include "StateTreeItemBlueprintBase.h"
#include "StateTreeConditionBlueprintBase.generated.h"
struct FStateTreeExecutionContext;
/*
* Base class for Blueprint based Conditions.
*/
UCLASS(Abstract, Blueprintable)
class STATETREEMODULE_API UStateTreeConditionBlueprintBase : public UStateTreeItemBlueprintBase
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent)
bool ReceiveTestCondition(AActor* OwnerActor);
virtual bool TestCondition(FStateTreeExecutionContext& Context);
};
/**
* Wrapper for Blueprint based Conditions.
*/
USTRUCT()
struct STATETREEMODULE_API FStateTreeBlueprintConditionWrapper : public FStateTreeConditionBase
{
GENERATED_BODY()
virtual const UStruct* GetInstanceDataType() const override { return ConditionClass; };
virtual bool Link(FStateTreeLinker& Linker) override;
virtual bool TestCondition(FStateTreeExecutionContext& Context) const override;
#if WITH_EDITOR
/** @return Rich text description of the condition. */
virtual FText GetDescription(const FGuid& ID, FStateTreeDataView InstanceData, const IStateTreeBindingLookup& BindingLookup) const;
#endif
UPROPERTY()
TSubclassOf<UStateTreeConditionBlueprintBase> ConditionClass = nullptr;
TArray<FStateTreeBlueprintExternalDataHandle> ExternalDataHandles;
};