PropertyHandlerUiParticleFloatKeyframe.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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/base.h>
  11. #include <AzCore/Memory/SystemAllocator.h>
  12. #include <AzToolsFramework/UI/PropertyEditor/PropertyColorCtrl.hxx>
  13. #include <AzToolsFramework/UI/PropertyEditor/PropertyDoubleSpinCtrl.hxx>
  14. #include <AzToolsFramework/UI/PropertyEditor/PropertyEnumComboBoxCtrl.hxx>
  15. #include <LyShine/Bus/UiParticleEmitterBus.h>
  16. #endif
  17. class PropertyUiParticleFloatKeyframeCtrl
  18. : public QWidget
  19. {
  20. Q_OBJECT
  21. public:
  22. AZ_CLASS_ALLOCATOR(PropertyUiParticleFloatKeyframeCtrl, AZ::SystemAllocator);
  23. PropertyUiParticleFloatKeyframeCtrl(QWidget* parent = nullptr);
  24. void ConsumeAttribute(AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName);
  25. AzToolsFramework::PropertyDoubleSpinCtrl* GetTimeCtrl();
  26. AzToolsFramework::PropertyDoubleSpinCtrl* GetMultiplierCtrl();
  27. AzToolsFramework::PropertyEnumComboBoxCtrl* GetInTangentCtrl();
  28. AzToolsFramework::PropertyEnumComboBoxCtrl* GetOutTangentCtrl();
  29. private:
  30. AzToolsFramework::PropertyDoubleSpinCtrl* m_timeCtrl;
  31. AzToolsFramework::PropertyDoubleSpinCtrl* m_multiplierCtrl;
  32. AzToolsFramework::PropertyEnumComboBoxCtrl* m_inTangentCtrl;
  33. AzToolsFramework::PropertyEnumComboBoxCtrl* m_outTangentCtrl;
  34. };
  35. class PropertyHandlerUiParticleFloatKeyframe
  36. : public AzToolsFramework::PropertyHandler < UiParticleEmitterInterface::ParticleFloatKeyframe, PropertyUiParticleFloatKeyframeCtrl >
  37. {
  38. public:
  39. AZ_CLASS_ALLOCATOR(PropertyHandlerUiParticleFloatKeyframe, AZ::SystemAllocator);
  40. AZ::u32 GetHandlerName(void) const override { return AZ_CRC("UiParticleFloatKeyframeCtrl", 0x448a90ec); }
  41. bool IsDefaultHandler() const override { return true; }
  42. QWidget* CreateGUI(QWidget* pParent) override;
  43. void ConsumeAttribute(PropertyUiParticleFloatKeyframeCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override;
  44. void WriteGUIValuesIntoProperty(size_t index, PropertyUiParticleFloatKeyframeCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override;
  45. bool ReadValuesIntoGUI(size_t index, PropertyUiParticleFloatKeyframeCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) override;
  46. AZ::EntityId GetParentEntityId(AzToolsFramework::InstanceDataNode* node, size_t index);
  47. static void Register();
  48. };