Minor fixes to pass AR
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
+6
-13
@@ -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
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ namespace AzToolsFramework::Prefab
|
||||
, private QObject
|
||||
{
|
||||
public:
|
||||
PrefabViewportFocusPathHandler();
|
||||
~PrefabViewportFocusPathHandler();
|
||||
|
||||
void Initialize(AzQtComponents::BreadCrumbs* breadcrumbsWidget, QToolButton* backButton);
|
||||
|
||||
Reference in New Issue
Block a user