Merge branch 'develop' into LYN-4700

Signed-off-by: igarri <igarri@amazon.com>
This commit is contained in:
igarri
2021-08-09 09:32:42 +01:00
313 changed files with 3322 additions and 5571 deletions
@@ -352,8 +352,20 @@ namespace UnitTest
AzToolsFramework::EditorEntityContextRequestBus::BroadcastResult(
entityId, &AzToolsFramework::EditorEntityContextRequestBus::Events::CreateNewEditorEntity, name);
if (!entityId.IsValid())
{
AZ_Error("CreateDefaultEditorEntity", false, "Failed to create editor entity '%s'", name);
return AZ::EntityId();
}
AZ::Entity* entity = GetEntityById(entityId);
if (!entity)
{
AZ_Error("CreateDefaultEditorEntity", false, "Invalid entity obtained from Id %s", entityId.ToString().c_str());
return AZ::EntityId();
}
entity->Deactivate();
// add required components for the Editor entity
@@ -11,7 +11,12 @@
namespace UnitTest
{
ToolsTestApplication::ToolsTestApplication(AZStd::string applicationName)
: ToolsApplication()
:ToolsTestApplication(AZStd::move(applicationName), 0, nullptr)
{
}
ToolsTestApplication::ToolsTestApplication(AZStd::string applicationName, int argc, char** argv)
: AzToolsFramework::ToolsApplication(&argc, &argv)
, m_applicationName(AZStd::move(applicationName))
{
}
@@ -18,6 +18,7 @@ namespace UnitTest
{
public:
explicit ToolsTestApplication(AZStd::string applicationName);
ToolsTestApplication(AZStd::string applicationName, int argc, char** argv);
void SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) override;
protected:
@@ -50,11 +50,19 @@ namespace AzToolsFramework
AzFramework::ViewportDebugDisplayEventBus::Handler::BusConnect(GetEntityContextId());
}
m_entityDataCache = AZStd::make_unique<EditorVisibleEntityDataCache>();
// temporarily disconnect from EditorInteractionSystemViewportSelectionRequestBus in case during the creation of
// m_interactionRequests (see interactionRequestsBuilder below) an event is propagated to the handler, if this happens then
// m_interactionRequests will be null as it will not have finished being created yet so we ensure no events are forwarded to it
EditorInteractionSystemViewportSelectionRequestBus::Handler::BusDisconnect();
m_interactionRequests.reset(); // BusConnect/Disconnect in constructor/destructor,
// so have to reset before assigning the new one
m_interactionRequests = interactionRequestsBuilder(m_entityDataCache.get());
{
m_entityDataCache = AZStd::make_unique<EditorVisibleEntityDataCache>();
m_interactionRequests.reset(); // BusConnect/Disconnect in constructor/destructor,
// so have to reset before assigning the new one
m_interactionRequests = interactionRequestsBuilder(m_entityDataCache.get());
}
EditorInteractionSystemViewportSelectionRequestBus::Handler::BusConnect(GetEntityContextId());
}
void EditorInteractionSystemComponent::SetDefaultHandler()
@@ -380,7 +380,6 @@ namespace AzToolsFramework::ViewportUi::Internal
}
PrepareWidgetForViewportUi(widget);
m_renderOverlay->setFocus();
}
void ViewportUiDisplay::SetUiOverlayContentsAnchored(QPointer<QWidget> widget, const Qt::Alignment alignment)
@@ -392,7 +391,6 @@ namespace AzToolsFramework::ViewportUi::Internal
PrepareWidgetForViewportUi(widget);
m_uiOverlayLayout.AddAnchoredWidget(widget, alignment);
m_renderOverlay->setFocus();
}
void ViewportUiDisplay::UpdateUiOverlayGeometry()