ViewportTitleDlg.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. #ifndef CRYINCLUDE_EDITOR_VIEWPORTTITLEDLG_H
  9. #define CRYINCLUDE_EDITOR_VIEWPORTTITLEDLG_H
  10. #pragma once
  11. #if !defined(Q_MOC_RUN)
  12. #include <AzCore/Component/Component.h>
  13. #include <functional>
  14. #include <QSharedPointer>
  15. #endif
  16. // CViewportTitleDlg dialog
  17. class CLayoutViewPane;
  18. class CPopupMenuItem;
  19. class QAbstractButton;
  20. class QMenu;
  21. struct ICVar;
  22. namespace Ui
  23. {
  24. class ViewportTitleDlg;
  25. }
  26. //////////////////////////////////////////////////////////////////////////
  27. class CViewportTitleDlg
  28. : public QWidget
  29. {
  30. Q_OBJECT
  31. public:
  32. CViewportTitleDlg(QWidget* pParent = nullptr); // standard constructor
  33. virtual ~CViewportTitleDlg();
  34. void SetViewPane(CLayoutViewPane* pViewPane);
  35. void SetTitle(const QString& title);
  36. static void LoadCustomPresets(const QString& section, const QString& keyName, QStringList& outCustompresets);
  37. static void SaveCustomPresets(const QString& section, const QString& keyName, const QStringList& custompresets);
  38. static void UpdateCustomPresets(const QString& text, QStringList& custompresets);
  39. bool eventFilter(QObject* object, QEvent* event) override;
  40. void SetNoViewportInfo();
  41. void SetNormalViewportInfo();
  42. void SetFullViewportInfo();
  43. void SetCompactViewportInfo();
  44. void OnToggleDisplayInfo();
  45. Q_SIGNALS:
  46. void ActionTriggered(int command);
  47. protected:
  48. virtual void OnInitDialog();
  49. void OnMaximize();
  50. QString m_title;
  51. CLayoutViewPane* m_pViewPane;
  52. static const int MAX_NUM_CUSTOM_PRESETS = 10;
  53. QStringList m_customResPresets;
  54. QStringList m_customFOVPresets;
  55. QStringList m_customAspectRatioPresets;
  56. float m_prevMoveSpeedScale;
  57. // Speed combobox/lineEdit settings
  58. double m_speedScaleMin = 0.001;
  59. double m_speedScaleMax = 100.0;
  60. double m_speedScaleStep = 0.01;
  61. int m_speedScaleDecimalCount = 3;
  62. void OnMenuFOVCustom();
  63. void OnMenuAspectRatioCustom();
  64. void OnMenuResolutionCustom();
  65. void OnBnClickedGotoPosition();
  66. void OnBnClickedMuteAudio();
  67. QScopedPointer<Ui::ViewportTitleDlg> m_ui;
  68. //! The different prefab edit mode effects available in the Edit mode menu.
  69. enum class PrefabEditModeUXSetting
  70. {
  71. Normal, //!< No effect.
  72. Monochromatic //!< Monochromatic effect.
  73. };
  74. //! The currently active edit mode effect.
  75. PrefabEditModeUXSetting m_prefabEditMode = PrefabEditModeUXSetting::Monochromatic;
  76. };
  77. namespace AzToolsFramework
  78. {
  79. //! A component to reflect scriptable commands for the Editor.
  80. class ViewportTitleDlgPythonFuncsHandler
  81. : public AZ::Component
  82. {
  83. public:
  84. AZ_COMPONENT(ViewportTitleDlgPythonFuncsHandler, "{2D686C2D-04F0-4C96-B432-0702E774062E}")
  85. SANDBOX_API static void Reflect(AZ::ReflectContext* context);
  86. // AZ::Component ...
  87. void Activate() override {}
  88. void Deactivate() override {}
  89. };
  90. } // namespace AzToolsFramework
  91. #endif // CRYINCLUDE_EDITOR_VIEWPORTTITLEDLG_H