LyShineModule.cpp 5.4 KB

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