Add support for border in Focus Mode (#4692)

* restore component mode border

Signed-off-by: hultonha <hultonha@amazon.co.uk>

* add viewport border for focus mode, remove dead code in ObjectManager

Signed-off-by: hultonha <hultonha@amazon.co.uk>

* ensure the focus mode border is restored when leaving component mode

Signed-off-by: hultonha <hultonha@amazon.co.uk>

* update FocusModeNotification call order after merge from development

Signed-off-by: hultonha <hultonha@amazon.co.uk>
This commit is contained in:
hultonha
2021-10-15 12:56:05 +01:00
committed by GitHub
parent bcc0861623
commit 5c8a1b573e
12 changed files with 130 additions and 81 deletions
@@ -71,12 +71,7 @@ namespace AzToolsFramework
return;
}
AZ::EntityId previousFocusEntityId = m_focusRoot;
m_focusRoot = entityId;
FocusModeNotificationBus::Broadcast(&FocusModeNotifications::OnEditorFocusChanged, previousFocusEntityId, m_focusRoot);
if (auto tracker = AZ::Interface<ViewportEditorModeTrackerInterface>::Get();
tracker != nullptr)
if (auto tracker = AZ::Interface<ViewportEditorModeTrackerInterface>::Get())
{
if (!m_focusRoot.IsValid() && entityId.IsValid())
{
@@ -87,6 +82,10 @@ namespace AzToolsFramework
tracker->DeactivateMode({ GetEntityContextId() }, ViewportEditorMode::Focus);
}
}
AZ::EntityId previousFocusEntityId = m_focusRoot;
m_focusRoot = entityId;
FocusModeNotificationBus::Broadcast(&FocusModeNotifications::OnEditorFocusChanged, previousFocusEntityId, m_focusRoot);
}
void FocusModeSystemComponent::ClearFocusRoot([[maybe_unused]] AzFramework::EntityContextId entityContextId)