Files
UnrealEngineUWP/Engine/Plugins/Runtime/GameplayStateTree/Source/GameplayStateTreeModule/Public/Tasks/StateTreeRunEnvQueryTask.h
mikko mononen ef148ecd80 StateTree: StateTree UI spring clean.
- Added icons and icon colors for ST nodes
- Implemented icons for some common ST nodes
- Small update to ST logic icons
- Added icons to the task list in State treeview row, adjusted task list BG color to make icons visible
- Fixed ST editor tabs icons and names (e.g. there were two tabs that had the same label)
- Moved ST node picker to separate class
- Moved category array customization to common helper function
- Added node icons to the ST node picker
- Add node button is not node selector too (simila to Niagara)
- Consolidated the add button style across all lists
- Cleaned up the node customization
  - Moved type selector, debug, and property controls into one menu at right
  - The combined menu can be also summoned using right click
  - Renaming now has to be triggered via the menu
  - Replacing node happens via menu
  - Most of the row was left "clickable" to later use it for selection
  - Improved the visualization and controls for the expression indentation
- Cleaned up state customization
  - Moved parameters to own category (similar to the tree params)
  - Moved event to the enter conditions category
- Cleaned up transition customization
  - Improved the transition display
  - Consolidated add button styles

#jira UE-180608
#rb Juan.Portillo, Mieszko.Zielinski

[CL 33030431 by mikko mononen in ue5-main branch]
2024-04-17 03:01:36 -04:00

76 lines
2.9 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "StateTreeTaskBase.h"
#include "EnvironmentQuery/EnvQueryTypes.h"
#include "NativeGameplayTags.h"
#include "StateTreePropertyRef.h"
#include "StateTreeRunEnvQueryTask.generated.h"
USTRUCT()
struct FStateTreeRunEnvQueryInstanceData
{
GENERATED_BODY()
// Result of the query. If an array is binded, it will output all the created values otherwise it will output the best one.
UPROPERTY(EditAnywhere, Category = Out, meta = (RefType = "/Script/CoreUObject.Vector, /Script/Engine.Actor", CanRefToArray))
FStateTreePropertyRef Result;
// The query will be run with this actor has the owner object.
UPROPERTY(EditAnywhere, Category = Context)
TObjectPtr<AActor> QueryOwner = nullptr;
// The query template to run
UPROPERTY(EditAnywhere, Category = Parameter)
TObjectPtr<UEnvQuery> QueryTemplate;
// Query config associated with the query template.
UPROPERTY(EditAnywhere, EditFixedSize, Category = Parameter)
TArray<FAIDynamicParam> QueryConfig;
/** determines which item will be stored (All = only first matching) */
UPROPERTY(EditAnywhere, Category = Parameter)
TEnumAsByte<EEnvQueryRunMode::Type> RunMode = EEnvQueryRunMode::SingleResult;
TSharedPtr<FEnvQueryResult> QueryResult = nullptr;
int32 RequestId = INDEX_NONE;
};
/**
* Task that runs an async environment query and outputs the result to an outside parameter. Supports Actor and vector types EQS.
* The task is usually run in a sibling state to the result user will be with the data being stored in the parent state's parameters.
* - Parent (Has an EQS result parameter)
* - Run Env Query (If success go to Use Query Result)
* - Use Query Result
*/
USTRUCT(meta = (DisplayName = "Run Env Query", Category = "Common"))
struct FStateTreeRunEnvQueryTask : public FStateTreeTaskCommonBase
{
GENERATED_BODY()
using FInstanceDataType = FStateTreeRunEnvQueryInstanceData;
virtual const UStruct* GetInstanceDataType() const override { return FInstanceDataType::StaticStruct(); }
virtual EStateTreeRunStatus EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const override;
virtual EStateTreeRunStatus Tick(FStateTreeExecutionContext& Context, const float DeltaTime) const override;
virtual void ExitState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const override;
#if WITH_EDITOR
virtual void PostEditInstanceDataChangeChainProperty(const FPropertyChangedChainEvent& PropertyChangedEvent, FStateTreeDataView InstanceDataView) override;
virtual FText GetDescription(const FGuid& ID, FStateTreeDataView InstanceDataView, const IStateTreeBindingLookup& BindingLookup, EStateTreeNodeFormatting Formatting = EStateTreeNodeFormatting::Text) const override;
virtual FName GetIconName() const override
{
return FName("StateTreeEditorStyle|Node.Find");
}
virtual FColor GetIconColor() const override
{
return UE::StateTree::Colors::Grey;
}
#endif // WITH_EDITOR
};