Files
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

60 lines
2.0 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "StateTreeTaskBase.h"
#include "StateTreeDelayTask.generated.h"
enum class EStateTreeRunStatus : uint8;
struct FStateTreeTransitionResult;
USTRUCT()
struct STATETREEMODULE_API FStateTreeDelayTaskInstanceData
{
GENERATED_BODY()
/** Delay before the task ends. */
UPROPERTY(EditAnywhere, Category = Parameter, meta = (EditCondition = "!bRunForever", ClampMin="0.0"))
float Duration = 1.f;
/** Adds random range to the Duration. */
UPROPERTY(EditAnywhere, Category = Parameter, meta = (EditCondition = "!bRunForever", ClampMin="0.0"))
float RandomDeviation = 0.f;
/** If true the task will run forever until a transition stops it. */
UPROPERTY(EditAnywhere, Category = Parameter)
bool bRunForever = false;
/** Internal countdown in seconds. */
float RemainingTime = 0.f;
};
/**
* Simple task to wait indefinitely or for a given time (in seconds) before succeeding.
*/
USTRUCT(meta = (DisplayName = "Delay Task"))
struct STATETREEMODULE_API FStateTreeDelayTask : public FStateTreeTaskCommonBase
{
GENERATED_BODY()
using FInstanceDataType = FStateTreeDelayTaskInstanceData;
FStateTreeDelayTask() = default;
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;
#if WITH_EDITOR
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.Time");
}
virtual FColor GetIconColor() const override
{
return UE::StateTree::Colors::Grey;
}
#endif
};