ImGuiLYCommonMenu.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 "ImGuiManager.h"
  10. #ifdef IMGUI_ENABLED
  11. #include <AzCore/Component/TickBus.h>
  12. #include "ImGuiBus.h"
  13. #include "ImGuiLYAssetExplorer.h"
  14. #include "ImGuiLYCameraMonitor.h"
  15. #include "ImGuiLYEntityOutliner.h"
  16. #include "ImGuiInputMonitor.h"
  17. namespace ImGui
  18. {
  19. //! ImGuiDropDownState refers to the state of dropdowns of the main menu bar.
  20. enum class ImGuiDropdownState
  21. {
  22. Shown,
  23. Hidden
  24. };
  25. class ImGuiLYCommonMenu
  26. : public ImGuiUpdateListenerBus::Handler
  27. , public AZ::TickBus::Handler
  28. {
  29. public:
  30. ImGuiLYCommonMenu();
  31. ~ImGuiLYCommonMenu();
  32. void Initialize();
  33. void Shutdown();
  34. // -- ImGuiUpdateListenerBus::Handler Interface ----------------------------
  35. void OnImGuiUpdate() override;
  36. // -- ImGuiUpdateListenerBus::Handler Interface ----------------------------
  37. // -- AZ::TickBus::Handler Interface ---------------------------------------
  38. void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
  39. // -- AZ::TickBus::Handler Interface ---------------------------------------
  40. private:
  41. void StartTelemetryCapture();
  42. void StopTelemetryCapture();
  43. void OnImGuiUpdate_DrawControllerLegend();
  44. float m_telemetryCaptureTime;
  45. float m_telemetryCaptureTimeRemaining;
  46. DisplayState m_telemetryCapturePreCaptureState;
  47. bool m_controllerLegendWindowVisible;
  48. ImGuiLYAssetExplorer m_assetExplorer;
  49. ImGuiLYCameraMonitor m_cameraMonitor;
  50. ImGuiLYEntityOutliner m_entityOutliner;
  51. ImGuiInputMonitor m_inputMonitor;
  52. bool m_showDeltaTimeGraphs = false;
  53. ImGui::LYImGuiUtils::HistogramContainer m_deltaTimeHistogram;
  54. ImGuiDropdownState m_dropdownState = ImGuiDropdownState::Hidden; //!< Keeps the state of the ImGui main menu dropdowns.
  55. //! Mark the dropdown for being hidden - this is used to prevent broadcasting that the dropdowns have been hidden
  56. //! in the case that the ImGui dropdown context has switched options.
  57. bool m_markedForHiding = false;
  58. bool m_showImGuiDemo = false;
  59. };
  60. }
  61. #endif // IMGUI_ENABLED