// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Widgets/SCompoundWidget.h" #include "Widgets/Views/STableRow.h" #include "Animation/SmartName.h" #include "Widgets/Input/SSearchBox.h" #include "PersonaDelegates.h" class IEditableSkeleton; class SAnimCurvePicker : public SCompoundWidget { public: /** Virtual destructor. */ virtual ~SAnimCurvePicker() override; SLATE_BEGIN_ARGS(SAnimCurvePicker) : _bEnableMultiselect(false) {} FOnCurvesPicked ConvertOnCurvePickedFn(const FOnCurvePicked& LegacyDelegate) { return FOnCurvesPicked::CreateLambda([LegacyDelegate](const TConstArrayView PickedCurves) { check(PickedCurves.Num() == 1) LegacyDelegate.ExecuteIfBound(PickedCurves[0]); }); } SLATE_EVENT_DEPRECATED(5.6, "Use FOnCurvesPicked instead", FOnCurvePicked, OnCurvePicked, OnCurvesPicked, ConvertOnCurvePickedFn) SLATE_EVENT(FOnCurvesPicked, OnCurvesPicked) SLATE_EVENT(FIsCurveNameMarkedForExclusion, IsCurveNameMarkedForExclusion) SLATE_ARGUMENT(bool, bEnableMultiselect) SLATE_END_ARGS() /** * Construct this widget. * @param InArgs - The declaration data for this widget * @param InSkeleton - The skeleton from which the widget extracts curve information */ void Construct(const FArguments& InArgs, const USkeleton* InSkeleton); private: /** Refresh the list of available curves */ void RefreshListItems(); /** Filter available curves */ void FilterAvailableCurves(); /** UI handlers */ TSharedRef HandleGenerateRow(TSharedPtr InItem, const TSharedRef& InOwnerTable); void HandleFilterTextChanged(const FText& InFilterText); private: /** Delegate fired when the curves selection is confirmed */ FOnCurvesPicked OnCurvesPicked; /* Filter predicate to determine if curve should be excluded from the picker's curve list */ FIsCurveNameMarkedForExclusion IsCurveNameMarkedForExclusion; /** The editable skeleton we use to grab curves from */ TWeakObjectPtr Skeleton; /** The names of the curves we are displaying */ TArray> CurveNames; /** All the unique curve names we can find */ TSet UniqueCurveNames; /** The string we use to filter curve names */ FString FilterText; /** The list view used to display names */ TSharedPtr>> NameListView; /** The search box used to filter curves */ TSharedPtr SearchBox; /** Whether we should show other skeleton's curves */ bool bShowOtherSkeletonCurves; };