Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/Blueprint/StateTreeConditionBlueprintBase.h
mikko mononen f0ccef43ca 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
#preflight 61a7302e9c77d6100788c8ad

#ROBOMERGE-AUTHOR: mikko.mononen
#ROBOMERGE-SOURCE: CL 18336889 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v895-18170469)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 18336898 by mikko mononen in ue5-release-engine-test branch]
2021-12-01 03:42:52 -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;
};