/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include namespace EMotionFX { class ActorInstance; } namespace EMStudio { class NodeSelectionWindow; class ActorJointBrowseEdit : public AzQtComponents::BrowseEdit { Q_OBJECT // AUTOMOC public: AZ_CLASS_ALLOCATOR_DECL explicit ActorJointBrowseEdit(QWidget* parent = nullptr); void SetSingleJointSelection(bool singleSelectionEnabled); void SetSelectedJoints(const AZStd::vector& selectedJoints); EMotionFX::ActorInstance* GetActorInstance() const; const AZStd::vector& GetPreviouslySelectedJoints() const { return m_previouslySelectedJoints; } signals: // Emitted when the new joint selection got accepted from the joint selection window. void SelectionDone(const AZStd::vector& selectedJoints); // Selection got rejected. In case reaction happened on the SelectionChanged() signal, handle going back to the original state. void SelectionRejected(const AZStd::vector& previouslySelectedJoints); // Emitted while the selection window is open and selection changes (final selection via SelectionDone() signal). void SelectionChanged(const AZStd::vector& selectedJoints); private slots: void OnBrowseButtonClicked(); void OnSelectionDone(const AZStd::vector& selectedJoints); void OnSelectionChanged(); void OnSelectionRejected(); void OnTextEdited(const QString& text); private: void UpdatePlaceholderText(); AZStd::vector m_previouslySelectedJoints; /// Selected joints before selection window opened. AZStd::vector m_selectedJoints; NodeSelectionWindow* m_jointSelectionWindow = nullptr; bool m_singleJointSelection = true; }; } // namespace EMStudio