From 6c1185bcbbab762ad3ae011ef75721d4b45c6867 Mon Sep 17 00:00:00 2001 From: Hulton-Harrop Date: Mon, 6 Sep 2021 14:55:49 +0100 Subject: [PATCH 1/3] rename CEditorPreferencesPage_ViewportMovmement to CEditorPreferencesPage_ViewportCamera Signed-off-by: Hulton-Harrop Signed-off-by: hultonha --- Code/Editor/EditorPreferencesDialog.cpp | 2 +- .../EditorPreferencesPageViewportMovement.cpp | 24 +++++++++---------- .../EditorPreferencesPageViewportMovement.h | 8 +++---- Code/Editor/PreferencesStdPages.cpp | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Code/Editor/EditorPreferencesDialog.cpp b/Code/Editor/EditorPreferencesDialog.cpp index 6cbbccb7ac..22c108ebf9 100644 --- a/Code/Editor/EditorPreferencesDialog.cpp +++ b/Code/Editor/EditorPreferencesDialog.cpp @@ -66,7 +66,7 @@ EditorPreferencesDialog::EditorPreferencesDialog(QWidget* pParent) CEditorPreferencesPage_Files::Reflect(*serializeContext); CEditorPreferencesPage_ViewportGeneral::Reflect(*serializeContext); CEditorPreferencesPage_ViewportManipulator::Reflect(*serializeContext); - CEditorPreferencesPage_ViewportMovement::Reflect(*serializeContext); + CEditorPreferencesPage_ViewportCamera::Reflect(*serializeContext); CEditorPreferencesPage_ViewportDebug::Reflect(*serializeContext); CEditorPreferencesPage_ExperimentalLighting::Reflect(*serializeContext); CEditorPreferencesPage_AWS::Reflect(*serializeContext); diff --git a/Code/Editor/EditorPreferencesPageViewportMovement.cpp b/Code/Editor/EditorPreferencesPageViewportMovement.cpp index 8b8506d694..a272b3759f 100644 --- a/Code/Editor/EditorPreferencesPageViewportMovement.cpp +++ b/Code/Editor/EditorPreferencesPageViewportMovement.cpp @@ -58,7 +58,7 @@ static AZStd::vector GetEditorInputNames() return inputNames; } -void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& serialize) +void CEditorPreferencesPage_ViewportCamera::Reflect(AZ::SerializeContext& serialize) { serialize.Class() ->Version(2) @@ -93,10 +93,10 @@ void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& seri ->Field("OrbitDolly", &CameraInputSettings::m_orbitDollyChannelId) ->Field("OrbitPan", &CameraInputSettings::m_orbitPanChannelId); - serialize.Class() + serialize.Class() ->Version(1) - ->Field("CameraMovementSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings) - ->Field("CameraInputSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraInputSettings); + ->Field("CameraMovementSettings", &CEditorPreferencesPage_ViewportCamera::m_cameraMovementSettings) + ->Field("CameraInputSettings", &CEditorPreferencesPage_ViewportCamera::m_cameraInputSettings); if (AZ::EditContext* editContext = serialize.GetEditContext()) { @@ -208,35 +208,35 @@ void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& seri "Key/button to begin camera orbit pan") ->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames); - editContext->Class("Viewport Preferences", "Viewport Preferences") + editContext->Class("Viewport Preferences", "Viewport Preferences") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20)) ->DataElement( - AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings, + AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportCamera::m_cameraMovementSettings, "Camera Movement Settings", "Camera Movement Settings") ->DataElement( - AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraInputSettings, "Camera Input Settings", + AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportCamera::m_cameraInputSettings, "Camera Input Settings", "Camera Input Settings"); } } -CEditorPreferencesPage_ViewportMovement::CEditorPreferencesPage_ViewportMovement() +CEditorPreferencesPage_ViewportCamera::CEditorPreferencesPage_ViewportCamera() { InitializeSettings(); m_icon = QIcon(":/res/Camera.svg"); } -const char* CEditorPreferencesPage_ViewportMovement::GetTitle() +const char* CEditorPreferencesPage_ViewportCamera::GetTitle() { return "Camera"; } -QIcon& CEditorPreferencesPage_ViewportMovement::GetIcon() +QIcon& CEditorPreferencesPage_ViewportCamera::GetIcon() { return m_icon; } -void CEditorPreferencesPage_ViewportMovement::OnApply() +void CEditorPreferencesPage_ViewportCamera::OnApply() { SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_translateSpeed); SandboxEditor::SetCameraRotateSpeed(m_cameraMovementSettings.m_rotateSpeed); @@ -271,7 +271,7 @@ void CEditorPreferencesPage_ViewportMovement::OnApply() &SandboxEditor::EditorModularViewportCameraComposerNotificationBus::Events::OnEditorModularViewportCameraComposerSettingsChanged); } -void CEditorPreferencesPage_ViewportMovement::InitializeSettings() +void CEditorPreferencesPage_ViewportCamera::InitializeSettings() { m_cameraMovementSettings.m_translateSpeed = SandboxEditor::CameraTranslateSpeed(); m_cameraMovementSettings.m_rotateSpeed = SandboxEditor::CameraRotateSpeed(); diff --git a/Code/Editor/EditorPreferencesPageViewportMovement.h b/Code/Editor/EditorPreferencesPageViewportMovement.h index b7482fb048..64a3702432 100644 --- a/Code/Editor/EditorPreferencesPageViewportMovement.h +++ b/Code/Editor/EditorPreferencesPageViewportMovement.h @@ -19,15 +19,15 @@ inline AZ::Crc32 EditorPropertyVisibility(const bool enabled) return enabled ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide; } -class CEditorPreferencesPage_ViewportMovement : public IPreferencesPage +class CEditorPreferencesPage_ViewportCamera : public IPreferencesPage { public: - AZ_RTTI(CEditorPreferencesPage_ViewportMovement, "{BC593332-7EAF-4171-8A35-1C5DE5B40909}", IPreferencesPage) + AZ_RTTI(CEditorPreferencesPage_ViewportCamera, "{BC593332-7EAF-4171-8A35-1C5DE5B40909}", IPreferencesPage) static void Reflect(AZ::SerializeContext& serialize); - CEditorPreferencesPage_ViewportMovement(); - virtual ~CEditorPreferencesPage_ViewportMovement() = default; + CEditorPreferencesPage_ViewportCamera(); + virtual ~CEditorPreferencesPage_ViewportCamera() = default; virtual const char* GetCategory() override { diff --git a/Code/Editor/PreferencesStdPages.cpp b/Code/Editor/PreferencesStdPages.cpp index 012a29368e..5cee5bd8da 100644 --- a/Code/Editor/PreferencesStdPages.cpp +++ b/Code/Editor/PreferencesStdPages.cpp @@ -35,7 +35,7 @@ CStdPreferencesClassDesc::CStdPreferencesClassDesc() [](){ return new CEditorPreferencesPage_General(); }, [](){ return new CEditorPreferencesPage_Files(); }, [](){ return new CEditorPreferencesPage_ViewportGeneral(); }, - [](){ return new CEditorPreferencesPage_ViewportMovement(); }, + [](){ return new CEditorPreferencesPage_ViewportCamera(); }, [](){ return new CEditorPreferencesPage_ViewportManipulator(); }, [](){ return new CEditorPreferencesPage_ViewportDebug(); } }; From 3e9a415b278a2db54e7db0fdda80caeb3c9c16af Mon Sep 17 00:00:00 2001 From: Hulton-Harrop Date: Mon, 6 Sep 2021 15:00:26 +0100 Subject: [PATCH 2/3] EditorPreferences modernize file rename Signed-off-by: Hulton-Harrop Signed-off-by: hultonha --- ...ewportMovement.cpp => EditorPreferencesPageViewportCamera.cpp} | 0 ...geViewportMovement.h => EditorPreferencesPageViewportCamera.h} | 0 ...portGizmo.cpp => EditorPreferencesPageViewportManipulator.cpp} | 0 ...ViewportGizmo.h => EditorPreferencesPageViewportManipulator.h} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename Code/Editor/{EditorPreferencesPageViewportMovement.cpp => EditorPreferencesPageViewportCamera.cpp} (100%) rename Code/Editor/{EditorPreferencesPageViewportMovement.h => EditorPreferencesPageViewportCamera.h} (100%) rename Code/Editor/{EditorPreferencesPageViewportGizmo.cpp => EditorPreferencesPageViewportManipulator.cpp} (100%) rename Code/Editor/{EditorPreferencesPageViewportGizmo.h => EditorPreferencesPageViewportManipulator.h} (100%) diff --git a/Code/Editor/EditorPreferencesPageViewportMovement.cpp b/Code/Editor/EditorPreferencesPageViewportCamera.cpp similarity index 100% rename from Code/Editor/EditorPreferencesPageViewportMovement.cpp rename to Code/Editor/EditorPreferencesPageViewportCamera.cpp diff --git a/Code/Editor/EditorPreferencesPageViewportMovement.h b/Code/Editor/EditorPreferencesPageViewportCamera.h similarity index 100% rename from Code/Editor/EditorPreferencesPageViewportMovement.h rename to Code/Editor/EditorPreferencesPageViewportCamera.h diff --git a/Code/Editor/EditorPreferencesPageViewportGizmo.cpp b/Code/Editor/EditorPreferencesPageViewportManipulator.cpp similarity index 100% rename from Code/Editor/EditorPreferencesPageViewportGizmo.cpp rename to Code/Editor/EditorPreferencesPageViewportManipulator.cpp diff --git a/Code/Editor/EditorPreferencesPageViewportGizmo.h b/Code/Editor/EditorPreferencesPageViewportManipulator.h similarity index 100% rename from Code/Editor/EditorPreferencesPageViewportGizmo.h rename to Code/Editor/EditorPreferencesPageViewportManipulator.h From b8f65cc78bffdfc50e32bb1cd8fd2124bfe7c91f Mon Sep 17 00:00:00 2001 From: hultonha Date: Mon, 6 Sep 2021 15:27:57 +0100 Subject: [PATCH 3/3] updates after file renames Signed-off-by: hultonha --- Code/Editor/EditorPreferencesDialog.cpp | 4 +-- .../EditorPreferencesPageViewportCamera.cpp | 17 +++++++++++- .../EditorPreferencesPageViewportCamera.h | 22 +++++----------- ...itorPreferencesPageViewportManipulator.cpp | 22 +++++++++++++++- ...EditorPreferencesPageViewportManipulator.h | 26 +++++-------------- Code/Editor/PreferencesStdPages.cpp | 4 +-- Code/Editor/editor_lib_files.cmake | 8 +++--- 7 files changed, 57 insertions(+), 46 deletions(-) diff --git a/Code/Editor/EditorPreferencesDialog.cpp b/Code/Editor/EditorPreferencesDialog.cpp index 22c108ebf9..c56df15908 100644 --- a/Code/Editor/EditorPreferencesDialog.cpp +++ b/Code/Editor/EditorPreferencesDialog.cpp @@ -27,8 +27,8 @@ #include "EditorPreferencesPageGeneral.h" #include "EditorPreferencesPageFiles.h" #include "EditorPreferencesPageViewportGeneral.h" -#include "EditorPreferencesPageViewportGizmo.h" -#include "EditorPreferencesPageViewportMovement.h" +#include "EditorPreferencesPageViewportManipulator.h" +#include "EditorPreferencesPageViewportCamera.h" #include "EditorPreferencesPageViewportDebug.h" #include "EditorPreferencesPageExperimentalLighting.h" #include "EditorPreferencesPageAWS.h" diff --git a/Code/Editor/EditorPreferencesPageViewportCamera.cpp b/Code/Editor/EditorPreferencesPageViewportCamera.cpp index a272b3759f..368d2769f8 100644 --- a/Code/Editor/EditorPreferencesPageViewportCamera.cpp +++ b/Code/Editor/EditorPreferencesPageViewportCamera.cpp @@ -8,7 +8,7 @@ #include "EditorDefs.h" -#include "EditorPreferencesPageViewportMovement.h" +#include "EditorPreferencesPageViewportCamera.h" #include #include @@ -226,6 +226,11 @@ CEditorPreferencesPage_ViewportCamera::CEditorPreferencesPage_ViewportCamera() m_icon = QIcon(":/res/Camera.svg"); } +const char* CEditorPreferencesPage_ViewportCamera::GetCategory() +{ + return "Viewports"; +} + const char* CEditorPreferencesPage_ViewportCamera::GetTitle() { return "Camera"; @@ -236,6 +241,16 @@ QIcon& CEditorPreferencesPage_ViewportCamera::GetIcon() return m_icon; } +void CEditorPreferencesPage_ViewportCamera::OnCancel() +{ + // noop +} + +bool CEditorPreferencesPage_ViewportCamera::OnQueryCancel() +{ + return true; +} + void CEditorPreferencesPage_ViewportCamera::OnApply() { SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_translateSpeed); diff --git a/Code/Editor/EditorPreferencesPageViewportCamera.h b/Code/Editor/EditorPreferencesPageViewportCamera.h index 64a3702432..31a728599f 100644 --- a/Code/Editor/EditorPreferencesPageViewportCamera.h +++ b/Code/Editor/EditorPreferencesPageViewportCamera.h @@ -29,22 +29,12 @@ public: CEditorPreferencesPage_ViewportCamera(); virtual ~CEditorPreferencesPage_ViewportCamera() = default; - virtual const char* GetCategory() override - { - return "Viewports"; - } - - virtual const char* GetTitle(); - virtual QIcon& GetIcon() override; - virtual void OnApply() override; - virtual void OnCancel() override - { - } - - virtual bool OnQueryCancel() override - { - return true; - } + const char* GetCategory() override; + const char* GetTitle() override; + QIcon& GetIcon() override; + void OnApply() override; + void OnCancel() override; + bool OnQueryCancel() override; private: void InitializeSettings(); diff --git a/Code/Editor/EditorPreferencesPageViewportManipulator.cpp b/Code/Editor/EditorPreferencesPageViewportManipulator.cpp index d1578f4f9c..ea00d6a7f0 100644 --- a/Code/Editor/EditorPreferencesPageViewportManipulator.cpp +++ b/Code/Editor/EditorPreferencesPageViewportManipulator.cpp @@ -8,7 +8,7 @@ #include "EditorDefs.h" -#include "EditorPreferencesPageViewportGizmo.h" +#include "EditorPreferencesPageViewportManipulator.h" // Editor #include "EditorViewportSettings.h" @@ -53,11 +53,31 @@ CEditorPreferencesPage_ViewportManipulator::CEditorPreferencesPage_ViewportManip m_icon = QIcon(":/res/Gizmos.svg"); } +const char* CEditorPreferencesPage_ViewportManipulator::GetCategory() +{ + return "Viewports"; +} + +const char* CEditorPreferencesPage_ViewportManipulator::GetTitle() +{ + return "Manipulators"; +} + QIcon& CEditorPreferencesPage_ViewportManipulator::GetIcon() { return m_icon; } +void CEditorPreferencesPage_ViewportManipulator::OnCancel() +{ + // noop +} + +bool CEditorPreferencesPage_ViewportManipulator::OnQueryCancel() +{ + return true; +} + void CEditorPreferencesPage_ViewportManipulator::OnApply() { SandboxEditor::SetManipulatorLineBoundWidth(m_manipulators.m_manipulatorLineBoundWidth); diff --git a/Code/Editor/EditorPreferencesPageViewportManipulator.h b/Code/Editor/EditorPreferencesPageViewportManipulator.h index 52270c3b0d..93db6a7035 100644 --- a/Code/Editor/EditorPreferencesPageViewportManipulator.h +++ b/Code/Editor/EditorPreferencesPageViewportManipulator.h @@ -25,26 +25,12 @@ public: CEditorPreferencesPage_ViewportManipulator(); virtual ~CEditorPreferencesPage_ViewportManipulator() = default; - virtual const char* GetCategory() override - { - return "Viewports"; - } - - virtual const char* GetTitle() override - { - return "Manipulators"; - } - - virtual QIcon& GetIcon() override; - virtual void OnApply() override; - virtual void OnCancel() override - { - } - - virtual bool OnQueryCancel() override - { - return true; - } + const char* GetCategory() override; + const char* GetTitle() override; + QIcon& GetIcon() override; + void OnApply() override; + void OnCancel() override; + bool OnQueryCancel() override; private: void InitializeSettings(); diff --git a/Code/Editor/PreferencesStdPages.cpp b/Code/Editor/PreferencesStdPages.cpp index 5cee5bd8da..1dd40702a7 100644 --- a/Code/Editor/PreferencesStdPages.cpp +++ b/Code/Editor/PreferencesStdPages.cpp @@ -17,8 +17,8 @@ #include "EditorPreferencesPageGeneral.h" #include "EditorPreferencesPageFiles.h" #include "EditorPreferencesPageViewportGeneral.h" -#include "EditorPreferencesPageViewportGizmo.h" -#include "EditorPreferencesPageViewportMovement.h" +#include "EditorPreferencesPageViewportManipulator.h" +#include "EditorPreferencesPageViewportCamera.h" #include "EditorPreferencesPageViewportDebug.h" #include "EditorPreferencesPageExperimentalLighting.h" #include "EditorPreferencesPageAWS.h" diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 24634b245d..031ad26d76 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -554,10 +554,10 @@ set(FILES EditorPreferencesPageFiles.cpp EditorPreferencesPageViewportGeneral.h EditorPreferencesPageViewportGeneral.cpp - EditorPreferencesPageViewportGizmo.h - EditorPreferencesPageViewportGizmo.cpp - EditorPreferencesPageViewportMovement.h - EditorPreferencesPageViewportMovement.cpp + EditorPreferencesPageViewportManipulator.h + EditorPreferencesPageViewportManipulator.cpp + EditorPreferencesPageViewportCamera.h + EditorPreferencesPageViewportCamera.cpp EditorPreferencesPageViewportDebug.h EditorPreferencesPageViewportDebug.cpp EditorPreferencesPageExperimentalLighting.h