LyShineModule.cpp 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. #include "LyShineModule.h"
  9. #include "LyShineSystemComponent.h"
  10. #if defined(LYSHINE_EDITOR)
  11. #include "LyShineEditorSystemComponent.h"
  12. #endif
  13. #include "LyShineLoadScreen.h"
  14. #include "UiCanvasComponent.h"
  15. #include "UiElementComponent.h"
  16. #include "UiTransform2dComponent.h"
  17. #include "UiImageComponent.h"
  18. #include "UiImageSequenceComponent.h"
  19. #include "UiTextComponent.h"
  20. #include "UiButtonComponent.h"
  21. #include "UiMarkupButtonComponent.h"
  22. #include "UiCheckboxComponent.h"
  23. #include "UiDraggableComponent.h"
  24. #include "UiDropTargetComponent.h"
  25. #include "UiDropdownComponent.h"
  26. #include "UiDropdownOptionComponent.h"
  27. #include "UiSliderComponent.h"
  28. #include "UiTextInputComponent.h"
  29. #include "UiScrollBarComponent.h"
  30. #include "UiScrollBoxComponent.h"
  31. #include "UiFaderComponent.h"
  32. #include "UiFlipbookAnimationComponent.h"
  33. #include "UiLayoutFitterComponent.h"
  34. #include "UiMaskComponent.h"
  35. #include "UiLayoutCellComponent.h"
  36. #include "UiLayoutColumnComponent.h"
  37. #include "UiLayoutRowComponent.h"
  38. #include "UiLayoutGridComponent.h"
  39. #include "UiParticleEmitterComponent.h"
  40. #include "UiRadioButtonComponent.h"
  41. #include "UiRadioButtonGroupComponent.h"
  42. #include "UiTooltipComponent.h"
  43. #include "UiTooltipDisplayComponent.h"
  44. #include "UiDynamicLayoutComponent.h"
  45. #include "UiDynamicScrollBoxComponent.h"
  46. #include "UiSpawnerComponent.h"
  47. #include "UiHierarchyInteractivityToggleComponent.h"
  48. #include "World/UiCanvasAssetRefComponent.h"
  49. #include "World/UiCanvasProxyRefComponent.h"
  50. #include "World/UiCanvasOnMeshComponent.h"
  51. #if defined(LYSHINE_BUILDER)
  52. #include "Pipeline/LyShineBuilder/LyShineBuilderComponent.h"
  53. #endif // LYSHINE_BUILDER
  54. #include <CryCommon/LoadScreenBus.h>
  55. namespace LyShine
  56. {
  57. LyShineModule::LyShineModule()
  58. : CryHooksModule()
  59. {
  60. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  61. m_descriptors.insert(m_descriptors.end(), {
  62. LyShineSystemComponent::CreateDescriptor(),
  63. #if defined(LYSHINE_EDITOR)
  64. LyShineEditor::LyShineEditorSystemComponent::CreateDescriptor(),
  65. #endif
  66. UiCanvasAssetRefComponent::CreateDescriptor(),
  67. UiCanvasProxyRefComponent::CreateDescriptor(),
  68. UiCanvasOnMeshComponent::CreateDescriptor(),
  69. UiCanvasComponent::CreateDescriptor(),
  70. UiElementComponent::CreateDescriptor(),
  71. UiTransform2dComponent::CreateDescriptor(),
  72. UiImageComponent::CreateDescriptor(),
  73. UiImageSequenceComponent::CreateDescriptor(),
  74. UiTextComponent::CreateDescriptor(),
  75. UiButtonComponent::CreateDescriptor(),
  76. UiMarkupButtonComponent::CreateDescriptor(),
  77. UiCheckboxComponent::CreateDescriptor(),
  78. UiDraggableComponent::CreateDescriptor(),
  79. UiDropTargetComponent::CreateDescriptor(),
  80. UiDropdownComponent::CreateDescriptor(),
  81. UiDropdownOptionComponent::CreateDescriptor(),
  82. UiSliderComponent::CreateDescriptor(),
  83. UiTextInputComponent::CreateDescriptor(),
  84. UiScrollBoxComponent::CreateDescriptor(),
  85. UiScrollBarComponent::CreateDescriptor(),
  86. UiFaderComponent::CreateDescriptor(),
  87. UiFlipbookAnimationComponent::CreateDescriptor(),
  88. UiLayoutFitterComponent::CreateDescriptor(),
  89. UiMaskComponent::CreateDescriptor(),
  90. UiLayoutCellComponent::CreateDescriptor(),
  91. UiLayoutColumnComponent::CreateDescriptor(),
  92. UiLayoutRowComponent::CreateDescriptor(),
  93. UiLayoutGridComponent::CreateDescriptor(),
  94. UiTooltipComponent::CreateDescriptor(),
  95. UiTooltipDisplayComponent::CreateDescriptor(),
  96. UiDynamicLayoutComponent::CreateDescriptor(),
  97. UiDynamicScrollBoxComponent::CreateDescriptor(),
  98. UiSpawnerComponent::CreateDescriptor(),
  99. UiRadioButtonComponent::CreateDescriptor(),
  100. UiRadioButtonGroupComponent::CreateDescriptor(),
  101. UiParticleEmitterComponent::CreateDescriptor(),
  102. UiHierarchyInteractivityToggleComponent::CreateDescriptor(),
  103. #if defined(LYSHINE_BUILDER)
  104. // Builder
  105. LyShineBuilder::LyShineBuilderComponent::CreateDescriptor(),
  106. #endif
  107. #if AZ_LOADSCREENCOMPONENT_ENABLED
  108. LyShineLoadScreenComponent::CreateDescriptor(),
  109. #endif
  110. });
  111. // This is so the metrics system knows which component LyShine is registering
  112. LyShineSystemComponent::SetLyShineComponentDescriptors(&m_descriptors);
  113. }
  114. /**
  115. * Add required SystemComponents to the SystemEntity.
  116. */
  117. AZ::ComponentTypeList LyShineModule::GetRequiredSystemComponents() const
  118. {
  119. return AZ::ComponentTypeList{
  120. azrtti_typeid<LyShineSystemComponent>(),
  121. #if defined(LYSHINE_EDITOR)
  122. azrtti_typeid<LyShineEditor::LyShineEditorSystemComponent>(),
  123. #endif
  124. #if AZ_LOADSCREENCOMPONENT_ENABLED
  125. azrtti_typeid<LyShineLoadScreenComponent>(),
  126. #endif
  127. };
  128. }
  129. }
  130. #if defined(O3DE_GEM_NAME)
  131. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), LyShine::LyShineModule)
  132. #else
  133. AZ_DECLARE_MODULE_CLASS(Gem_LyShine, LyShine::LyShineModule)
  134. #endif