Minor fixes to pass AR

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
Danilo Aimini
2021-09-22 16:12:11 -07:00
parent 55e2684471
commit be88be4bb8
4 changed files with 105 additions and 103 deletions
@@ -8,6 +8,7 @@
#include <AzToolsFramework/Prefab/PrefabFocusHandler.h>
#include <AzToolsFramework/Entity/EditorEntityHelpers.h>
#include <AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h>
#include <AzToolsFramework/Prefab/Instance/Instance.h>
#include <AzToolsFramework/Prefab/Instance/InstanceEntityMapperInterface.h>
@@ -83,11 +84,17 @@ namespace AzToolsFramework::Prefab
m_focusedInstance = focusedInstance;
m_focusedTemplateId = focusedInstance->get().GetTemplateId();
FocusModeInterface* focusModeInterface = AZ::Interface<FocusModeInterface>::Get();
if (focusModeInterface)
{
focusModeInterface->SetFocusRoot(focusedInstance->get().GetContainerEntityId());
}
AZ::EntityId containerEntityId = focusedInstance->get().GetContainerEntityId();
// Select the container entity
AzToolsFramework::SelectEntity(containerEntityId);
// Focus on the descendants of the container entity
FocusModeInterface* focusModeInterface = AZ::Interface<FocusModeInterface>::Get();
if (focusModeInterface)
{
focusModeInterface->SetFocusRoot(containerEntityId);
}
RefreshInstanceFocusList();
@@ -11,6 +11,12 @@
namespace AzToolsFramework::Prefab
{
PrefabViewportFocusPathHandler::PrefabViewportFocusPathHandler()
{
// Connect to Prefab Focus Notifications
PrefabFocusNotificationBus::Handler::BusConnect();
}
PrefabViewportFocusPathHandler::~PrefabViewportFocusPathHandler()
{
// Disconnect from Prefab Focus Notifications
@@ -27,9 +33,6 @@ namespace AzToolsFramework::Prefab
return;
}
// Connect to Prefab Focus Notifications
PrefabFocusNotificationBus::Handler::BusConnect();
// Initialize Widgets
m_breadcrumbsWidget = breadcrumbsWidget;
m_backButton = backButton;
@@ -60,16 +63,6 @@ namespace AzToolsFramework::Prefab
{
// Push new Path
m_breadcrumbsWidget->pushPath(m_prefabFocusInterface->GetPrefabFocusPath().c_str());
// Only show the back icon button if the path has more than one element
if(m_prefabFocusInterface->GetPrefabFocusPathLength() > 1)
{
m_backButton->show();
}
else
{
m_backButton->hide();
}
}
} // namespace AzToolsFramework::Prefab
@@ -24,6 +24,7 @@ namespace AzToolsFramework::Prefab
, private QObject
{
public:
PrefabViewportFocusPathHandler();
~PrefabViewportFocusPathHandler();
void Initialize(AzQtComponents::BreadCrumbs* breadcrumbsWidget, QToolButton* backButton);