DynamicOrderingDynamicSlotComponent.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include <Editor/GraphCanvas/Components/DynamicSlotComponent.h>
  10. namespace ScriptCanvasEditor
  11. {
  12. // Should be used when the order of slots might be re-arranged at edit time.
  13. // Will handle synchronizing and updating the various slots.
  14. //
  15. // Will do extra work, so should not be used all the time
  16. class DynamicOrderingDynamicSlotComponent
  17. : public DynamicSlotComponent
  18. , public AZ::SystemTickBus::Handler
  19. {
  20. public:
  21. AZ_COMPONENT(DynamicOrderingDynamicSlotComponent, "{90205620-E77B-4F09-8891-A0B1AE5E83EA}", DynamicSlotComponent);
  22. static void Reflect(AZ::ReflectContext* reflectContext);
  23. DynamicOrderingDynamicSlotComponent();
  24. DynamicOrderingDynamicSlotComponent(GraphCanvas::SlotGroup slotGroup);
  25. ~DynamicOrderingDynamicSlotComponent() override = default;
  26. // AZ::SystemTickBus
  27. void OnSystemTick() override;
  28. ////
  29. // SceneMemberNotificationBus
  30. void OnSceneSet(const AZ::EntityId& sceneId) override;
  31. void OnSceneMemberDeserialized(const AZ::EntityId& graphId, const GraphCanvas::GraphSerialization& serializationTarget) override;
  32. ////
  33. // NodeNotifications
  34. void OnSlotsReordered() override;
  35. ////
  36. // DynamicRequestBus
  37. void StopQueueSlotUpdates() override;
  38. ////
  39. protected:
  40. void ConfigureGraphCanvasSlot(const ScriptCanvas::Slot* slot, const GraphCanvas::SlotId& graphCanvasSlotId) override;
  41. private:
  42. bool m_deserialized;
  43. };
  44. }