// 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, WidgetWindow) SLATE_ARGUMENT(TArray, 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>& 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 WidgetWindow; TSharedPtr ModifierInstanceDetailsView; TSharedPtr AddModifierCombobox; TSharedPtr ModifierListView; /** Data structures used by the Modifier List View widget */ TArray> ModifierItems; /** Current set of Animation Modifiers that would be added during Apply */ TArray Modifiers; /** Previously user-selected Animation Sequences */ TArray AnimSequences; };