Merge branch upstream/stabilization/2110

* Conflict GemModel.h

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
This commit is contained in:
Alex Peterson
2021-11-04 17:02:00 -07:00
241 changed files with 2960 additions and 1633 deletions
@@ -2180,20 +2180,9 @@ namespace AzToolsFramework
void EntityOutlinerItemDelegate::PaintAncestorForegrounds(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
// Go through ancestors and add them to the stack
AZStd::stack<QModelIndex> handlerStack;
// Ancestor foregrounds are painted on top of the childrens'.
for (QModelIndex ancestorIndex = index.parent(); ancestorIndex.isValid(); ancestorIndex = ancestorIndex.parent())
{
handlerStack.push(ancestorIndex);
}
// Apply the ancestor overrides from top to bottom
while (!handlerStack.empty())
{
QModelIndex ancestorIndex = handlerStack.top();
handlerStack.pop();
AZ::EntityId ancestorEntityId(ancestorIndex.data(EntityOutlinerListModel::EntityIdRole).value<AZ::u64>());
auto ancestorUiHandler = m_editorEntityFrameworkInterface->GetHandler(ancestorEntityId);
@@ -55,6 +55,7 @@
#include <QMenu>
#include <QMessageBox>
#include <QScrollArea>
#include <QTimer>
#include <QVBoxLayout>
#include <QWidget>
@@ -151,6 +152,7 @@ namespace AzToolsFramework
PrefabInstanceContainerNotificationBus::Handler::BusConnect();
AZ::Interface<PrefabIntegrationInterface>::Register(this);
AssetBrowser::AssetBrowserSourceDropBus::Handler::BusConnect(s_prefabFileExtension);
EditorEntityContextNotificationBus::Handler::BusConnect();
InitializeShortcuts();
}
@@ -159,6 +161,7 @@ namespace AzToolsFramework
{
UninitializeShortcuts();
EditorEntityContextNotificationBus::Handler::BusDisconnect();
AssetBrowser::AssetBrowserSourceDropBus::Handler::BusDisconnect();
AZ::Interface<PrefabIntegrationInterface>::Unregister(this);
PrefabInstanceContainerNotificationBus::Handler::BusDisconnect();
@@ -423,6 +426,24 @@ namespace AzToolsFramework
}
}
void PrefabIntegrationManager::OnStartPlayInEditorBegin()
{
// Focus on the root prefab (AZ::EntityId() will default to it)
s_prefabFocusPublicInterface->FocusOnOwningPrefab(AZ::EntityId());
}
void PrefabIntegrationManager::OnStopPlayInEditor()
{
// Refresh all containers when leaving Game Mode to ensure everything is synced.
QTimer::singleShot(
0,
[&]()
{
s_containerEntityInterface->RefreshAllContainerEntities(s_editorEntityContextId);
}
);
}
void PrefabIntegrationManager::ContextMenu_CreatePrefab(AzToolsFramework::EntityIdList selectedEntities)
{
// Save a reference to our currently active window since it will be
@@ -14,6 +14,7 @@
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
#include <AzToolsFramework/AssetBrowser/AssetBrowserSourceDropBus.h>
#include <AzToolsFramework/Editor/EditorContextMenuBus.h>
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
#include <AzToolsFramework/Prefab/PrefabPublicInterface.h>
#include <AzToolsFramework/Prefab/PrefabSystemComponentInterface.h>
#include <AzToolsFramework/UI/Prefab/LevelRootUiHandler.h>
@@ -56,6 +57,7 @@ namespace AzToolsFramework
, public PrefabInstanceContainerNotificationBus::Handler
, public PrefabIntegrationInterface
, public QObject
, private EditorEntityContextNotificationBus::Handler
{
public:
AZ_CLASS_ALLOCATOR(PrefabIntegrationManager, AZ::SystemAllocator, 0);
@@ -76,6 +78,10 @@ namespace AzToolsFramework
// EntityOutlinerSourceDropHandlingBus overrides ...
void HandleSourceFileType(AZStd::string_view sourceFilePath, AZ::EntityId parentId, AZ::Vector3 position) const override;
// EditorEntityContextNotificationBus overrides ...
void OnStartPlayInEditorBegin() override;
void OnStopPlayInEditor() override;
// PrefabInstanceContainerNotificationBus overrides ...
void OnPrefabComponentActivate(AZ::EntityId entityId) override;
void OnPrefabComponentDeactivate(AZ::EntityId entityId) override;
@@ -185,7 +185,7 @@ namespace AzToolsFramework
painter->restore();
}
void PrefabUiHandler::PaintDescendantBackground(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index,
void PrefabUiHandler::PaintDescendantForeground(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index,
const QModelIndex& descendantIndex) const
{
if (!painter)
@@ -36,9 +36,12 @@ namespace AzToolsFramework
QString GenerateItemTooltip(AZ::EntityId entityId) const override;
QIcon GenerateItemIcon(AZ::EntityId entityId) const override;
void PaintItemBackground(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
void PaintDescendantBackground(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index,
const QModelIndex& descendantIndex) const override;
void PaintItemForeground(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
void PaintDescendantForeground(
QPainter* painter,
const QStyleOptionViewItem& option,
const QModelIndex& index,
const QModelIndex& descendantIndex) const override;
bool OnOutlinerItemClick(const QPoint& position, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
void OnOutlinerItemCollapse(const QModelIndex& index) const override;
bool OnEntityDoubleClick(AZ::EntityId entityId) const override;