EditorPreferencesPageGeneral.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 "Include/IPreferencesPage.h"
  10. #include <AzCore/RTTI/TypeInfoSimple.h>
  11. #include <AzCore/RTTI/RTTIMacros.h>
  12. #include <AzCore/Math/Vector3.h>
  13. #include <AzQtComponents/Components/Widgets/ToolBar.h>
  14. #include <AzToolsFramework/Editor/EditorSettingsAPIBus.h>
  15. #include <AzToolsFramework/Prefab/PrefabLoaderInterface.h>
  16. #include <QIcon>
  17. #include "Settings.h"
  18. namespace AZ
  19. {
  20. class SerializeContext;
  21. }
  22. class CEditorPreferencesPage_General
  23. : public IPreferencesPage
  24. {
  25. public:
  26. AZ_RTTI(CEditorPreferencesPage_General, "{9CFBBE85-560D-4720-A830-50EF25D06ED5}", IPreferencesPage)
  27. static void Reflect(AZ::SerializeContext& serialize);
  28. CEditorPreferencesPage_General();
  29. virtual ~CEditorPreferencesPage_General() = default;
  30. virtual const char* GetCategory() override { return "General Settings"; }
  31. virtual const char* GetTitle() override;
  32. virtual QIcon& GetIcon() override;
  33. virtual void OnApply() override;
  34. virtual void OnCancel() override {}
  35. virtual bool OnQueryCancel() override { return true; }
  36. private:
  37. void InitializeSettings();
  38. struct GeneralSettings
  39. {
  40. AZ_TYPE_INFO(GeneralSettings, "{C2AE8F6D-7AA6-499E-A3E8-ECCD0AC6F3D2}")
  41. bool m_previewPanel;
  42. bool m_enableSourceControl = false;
  43. bool m_clearConsoleOnGameModeStart;
  44. AzToolsFramework::ConsoleColorTheme m_consoleBackgroundColorTheme;
  45. bool m_autoLoadLastLevel;
  46. bool m_bShowTimeInConsole;
  47. AzQtComponents::ToolBar::ToolBarIconSize m_toolbarIconSize;
  48. bool m_stylusMode;
  49. bool m_restoreViewportCamera;
  50. bool m_bShowNews;
  51. bool m_enableSceneInspector;
  52. };
  53. struct LevelSaveSettings // do not change the name or the UUID of this struct for backward settings compat.
  54. {
  55. AZ_TYPE_INFO(LevelSaveSettings, "{E297DAE3-3985-4BC2-8B43-45F3B1522F6B}");
  56. AzToolsFramework::Prefab::SaveAllPrefabsPreference m_saveAllPrefabsPreference;
  57. bool m_bDetachPrefabRemovesContainer;
  58. };
  59. struct Messaging
  60. {
  61. AZ_TYPE_INFO(Messaging, "{A6AD87CB-E905-409B-A2BF-C43CDCE63B0C}")
  62. bool m_showDashboard;
  63. };
  64. struct Undo
  65. {
  66. AZ_TYPE_INFO(Undo, "{A3AC0728-F132-4BF2-B122-8A631B636E81}")
  67. int m_undoLevels;
  68. };
  69. GeneralSettings m_generalSettings;
  70. LevelSaveSettings m_levelSaveSettings;
  71. Messaging m_messaging;
  72. Undo m_undo;
  73. QIcon m_icon;
  74. };
  75. static constexpr const char* EditorPreferencesGeneralRestoreViewportCameraSettingName = "Restore Viewport Camera on Game Mode Exit";