Files
UnrealEngineUWP/Engine/Source/Editor/AnimationModifiers/Private/SAnimationModifierContentBrowserWindow.h
Jurre deBaare 9cd11ebaea Running Anim Modifiers on a selection of animations
#jira UE-52080
#rb Thomas.Sarkanen

[CL 4688597 by Jurre deBaare in Dev-Anim branch]
2019-01-08 11:04:38 -05:00

67 lines
2.4 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Widgets/SCompoundWidget.h"
#include "Widgets/SWindow.h"
#include "Widgets/Input/SButton.h"
#include "Templates/SharedPointer.h"
#include "Containers/Array.h"
class SButton;
class SComboButton;
class SModifierListView;
class SMenuAnchor;
class UAnimationModifier;
class UAnimSequence;
class IDetailsView;
struct FModifierListviewItem;
/** UI slate widget allowing the user to add Animation Modifier(s) to a selection of Animation Sequences */
class SAnimationModifierContentBrowserWindow : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SAnimationModifierContentBrowserWindow)
: _WidgetWindow()
{}
SLATE_ARGUMENT(TSharedPtr<SWindow>, WidgetWindow)
SLATE_ARGUMENT(TArray<UAnimSequence*>, AnimSequences)
SLATE_END_ARGS()
public:
SAnimationModifierContentBrowserWindow() {}
void Construct(const FArguments& InArgs);
virtual bool SupportsKeyboardFocus() const override { return true; }
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override;
protected:
/** Callback for when the user picks a specific animation modifier class */
void OnModifierPicked(UClass* PickedClass);
/** Callback for when the user wants to remove modifier(s) from the listview */
void RemoveModifiersCallback(const TArray<TWeakObjectPtr<UAnimationModifier>>& ModifiersToRemove);
/** Creates the details view widget used to show Animation Modifier object details */
void CreateInstanceDetailsView();
/** Button callback, this applies all currently set up Animation Modifiers to the previously selected Animation Sequences */
FReply OnApply();
/** Button callback, closes the dialog/window */
FReply OnCancel();
/** Check to see whether or not the user can apply the modifiers in the current state */
bool CanApply() const;
private:
/** Window owning this window */
TWeakPtr<SWindow> WidgetWindow;
TSharedPtr<IDetailsView> ModifierInstanceDetailsView;
TSharedPtr<SMenuAnchor> AddModifierCombobox;
TSharedPtr<SModifierListView> ModifierListView;
/** Data structures used by the Modifier List View widget */
TArray<TSharedPtr<FModifierListviewItem>> ModifierItems;
/** Current set of Animation Modifiers that would be added during Apply */
TArray<UAnimationModifier*> Modifiers;
/** Previously user-selected Animation Sequences */
TArray<UAnimSequence*> AnimSequences;
};