MotionSetNameHandler.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <AzCore/Asset/AssetCommon.h>
  11. #include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
  12. #include <QComboBox>
  13. #endif
  14. namespace EMotionFX
  15. {
  16. namespace Integration
  17. {
  18. class MotionSetAsset;
  19. }
  20. class MotionSetNameHandler
  21. : public QObject
  22. , public AzToolsFramework::PropertyHandler<AZStd::string, QComboBox>
  23. {
  24. Q_OBJECT
  25. public:
  26. AZ_CLASS_ALLOCATOR_DECL
  27. MotionSetNameHandler()
  28. : m_motionSetAsset(nullptr)
  29. {}
  30. AZ::u32 GetHandlerName() const override;
  31. QWidget* CreateGUI(QWidget* parent) override;
  32. bool AutoDelete() const override { return false; }
  33. void ConsumeAttribute(QComboBox* widget, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override;
  34. void WriteGUIValuesIntoProperty(size_t index, QComboBox* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override;
  35. bool ReadValuesIntoGUI(size_t index, QComboBox* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) override;
  36. private:
  37. AZ::Data::Asset<Integration::MotionSetAsset>* m_motionSetAsset;
  38. };
  39. } // namespace EMotionFX