diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp index 666700a874..b9e4878879 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp @@ -142,8 +142,7 @@ void GetSelectedEntitiesSetWithFlattenedHierarchy(AzToolsFramework::EntityIdSet& } SandboxIntegrationManager::SandboxIntegrationManager() - : m_inObjectPickMode(false) - , m_startedUndoRecordingNestingLevel(0) + : m_startedUndoRecordingNestingLevel(0) , m_dc(nullptr) , m_notificationWindowManager(new AzToolsFramework::SliceOverridesNotificationWindowManager()) { @@ -1000,62 +999,6 @@ void SandboxIntegrationManager::SetupSliceContextMenu_Modify(QMenu* menu, const revertAction->setEnabled(canRevert); } -void SandboxIntegrationManager::HandleObjectModeSelection(const AZ::Vector2& point, [[maybe_unused]] int flags, bool& handled) -{ - // Todo - Use a custom "edit tool". This will eliminate the need for this bus message entirely, which technically - // makes this feature less intrusive on Sandbox. - // UPDATE: This is now provided by EditorPickEntitySelection when the new Viewport Interaction Model changes are enabled. - if (m_inObjectPickMode) - { - CViewport* view = GetIEditor()->GetViewManager()->GetGameViewport(); - const QPoint viewPoint(static_cast(point.GetX()), static_cast(point.GetY())); - - HitContext hitInfo; - hitInfo.view = view; - if (view->HitTest(viewPoint, hitInfo)) - { - if (hitInfo.object && (hitInfo.object->GetType() == OBJTYPE_AZENTITY)) - { - CComponentEntityObject* entityObject = static_cast(hitInfo.object); - AzToolsFramework::EditorPickModeRequestBus::Broadcast( - &AzToolsFramework::EditorPickModeRequests::PickModeSelectEntity, entityObject->GetAssociatedEntityId()); - } - } - - AzToolsFramework::EditorPickModeRequestBus::Broadcast( - &AzToolsFramework::EditorPickModeRequests::StopEntityPickMode); - - handled = true; - } -} - -void SandboxIntegrationManager::UpdateObjectModeCursor(AZ::u32& cursorId, AZStd::string& cursorStr) -{ - if (m_inObjectPickMode) - { - cursorId = static_cast(STD_CURSOR_HAND); - cursorStr = "Pick an entity..."; - } -} - -void SandboxIntegrationManager::OnEntityPickModeStarted() -{ - m_inObjectPickMode = true; - - // Currently this object pick mode is activated only via PropertyEntityIdCtrl picker. - // When the picker button is clicked, we transfer focus to the viewport so the - // spacebar can still be used to activate selection helpers. - if (CViewport* view = GetIEditor()->GetViewManager()->GetGameViewport()) - { - view->SetFocus(); - } -} - -void SandboxIntegrationManager::OnEntityPickModeStopped() -{ - m_inObjectPickMode = false; -} - void SandboxIntegrationManager::CreateEditorRepresentation(AZ::Entity* entity) { IEditor* editor = GetIEditor(); diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h index 617c5cb2c8..40962409a3 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h @@ -93,7 +93,6 @@ namespace AzToolsFramework class SandboxIntegrationManager : private AzToolsFramework::ToolsApplicationEvents::Bus::Handler , private AzToolsFramework::EditorRequests::Bus::Handler - , private AzToolsFramework::EditorPickModeNotificationBus::Handler , private AzToolsFramework::EditorContextMenuBus::Handler , private AzToolsFramework::EditorWindowRequests::Bus::Handler , private AzFramework::AssetCatalogEventBus::Handler @@ -140,8 +139,6 @@ private: QDockWidget* InstanceViewPane(const char* paneName) override; void CloseViewPane(const char* paneName) override; void BrowseForAssets(AzToolsFramework::AssetBrowser::AssetSelectionModel& selection) override; - void HandleObjectModeSelection(const AZ::Vector2& point, int flags, bool& handled) override; - void UpdateObjectModeCursor(AZ::u32& cursorId, AZStd::string& cursorStr) override; void CreateEditorRepresentation(AZ::Entity* entity) override; bool DestroyEditorRepresentation(AZ::EntityId entityId, bool deleteAZEntity) override; void CloneSelection(bool& handled) override; @@ -175,10 +172,6 @@ private: QWidget* GetAppMainWindow() override; ////////////////////////////////////////////////////////////////////////// - // EditorPickModeNotificationBus - void OnEntityPickModeStarted() override; - void OnEntityPickModeStopped() override; - ////////////////////////////////////////////////////////////////////////// // AzToolsFramework::EditorContextMenu::Bus::Handler overrides void PopulateEditorGlobalContextMenu(QMenu* menu, const AZ::Vector2& point, int flags) override; @@ -281,7 +274,6 @@ private: private: AZ::Vector2 m_contextMenuViewPoint; - int m_inObjectPickMode; short m_startedUndoRecordingNestingLevel; // used in OnBegin/EndUndo to ensure we only accept undo's we started recording AzToolsFramework::SliceOverridesNotificationWindowManager* m_notificationWindowManager; diff --git a/Code/Editor/Viewport.h b/Code/Editor/Viewport.h index fdb8332479..7f8ccc4c4f 100644 --- a/Code/Editor/Viewport.h +++ b/Code/Editor/Viewport.h @@ -157,7 +157,7 @@ public: virtual Vec3 SnapToGrid(const Vec3& vec) = 0; - //! Get selection procision tolerance. + //! Get selection precision tolerance. virtual float GetSelectionTolerance() const = 0; ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h index c037747a08..9e29b9813c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h @@ -764,12 +764,6 @@ namespace AzToolsFramework //! Spawn asset browser for the appropriate asset types. virtual void BrowseForAssets(AssetBrowser::AssetSelectionModel& /*selection*/) = 0; - /// Allow interception of selection / left-mouse clicks in ObjectMode, for customizing selection behavior. - virtual void HandleObjectModeSelection(const AZ::Vector2& /*point*/, int /*flags*/, bool& /*handled*/) {} - - /// Allow interception of cursor, for customizing selection behavior. - virtual void UpdateObjectModeCursor(AZ::u32& /*cursorId*/, AZStd::string& /*cursorStr*/) {} - /// Creates editor-side representation of an underlying entity. virtual void CreateEditorRepresentation(AZ::Entity* /*entity*/) { }