merge from main

This commit is contained in:
greerdv
2021-05-24 11:27:43 +01:00
640 changed files with 15110 additions and 14080 deletions
@@ -457,15 +457,6 @@ void EditorViewportWidget::Update()
return;
}
static bool sentOnWindowCreated = false;
if (!sentOnWindowCreated && windowHandle()->isActive())
{
sentOnWindowCreated = true;
AzFramework::WindowSystemNotificationBus::Broadcast(
&AzFramework::WindowSystemNotificationBus::Handler::OnWindowCreated,
reinterpret_cast<AzFramework::NativeWindowHandle>(winId()));
}
m_updatingCameraPosition = true;
if (!ed_useNewCameraSystem)
{
@@ -97,17 +97,34 @@ namespace SandboxEditor
AzFramework::ViewportDebugDisplayEventBus::Handler::BusDisconnect();
}
// should the camera system respond to this particular event
static bool ShouldHandle(const AzFramework::ViewportControllerPriority priority, const bool exclusive)
{
// ModernViewportCameraControllerInstance receives events at all priorities, it should only respond
// to normal priority events if it is not in 'exclusive' mode and when in 'exclusive' mode it should
// only respond to the highest priority events
return !exclusive && priority == AzFramework::ViewportControllerPriority::Normal ||
exclusive && priority == AzFramework::ViewportControllerPriority::Highest;
}
bool ModernViewportCameraControllerInstance::HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event)
{
AzFramework::WindowSize windowSize;
AzFramework::WindowRequestBus::EventResult(
windowSize, event.m_windowHandle, &AzFramework::WindowRequestBus::Events::GetClientAreaSize);
if (ShouldHandle(event.m_priority, m_cameraSystem.m_cameras.Exclusive()))
{
return m_cameraSystem.HandleEvents(AzFramework::BuildInputEvent(event.m_inputChannel));
}
return m_cameraSystem.HandleEvents(AzFramework::BuildInputEvent(event.m_inputChannel, windowSize));
return false;
}
void ModernViewportCameraControllerInstance::UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event)
{
// only update for a single priority (normal is the default)
if (event.m_priority != AzFramework::ViewportControllerPriority::Normal)
{
return;
}
if (auto viewportContext = RetrieveViewportContext(GetViewportId()))
{
m_updatingTransform = true;
@@ -22,7 +22,9 @@
namespace SandboxEditor
{
class ModernViewportCameraControllerInstance;
class ModernViewportCameraController : public AzFramework::MultiViewportController<ModernViewportCameraControllerInstance>
class ModernViewportCameraController
: public AzFramework::MultiViewportController<
ModernViewportCameraControllerInstance, AzFramework::ViewportControllerPriority::DispatchToAllPriorities>
{
public:
using CameraListBuilder = AZStd::function<void(AzFramework::Cameras&)>;
+5
View File
@@ -38,6 +38,11 @@ AzToolsFramework--ComponentPaletteWidget > QTreeView
background-color: #222222;
}
AzToolsFramework--PropertyRowWidget[canBeReordered="true"] QLabel#Name
{
font-weight: bold;
}
/* Style for visualizing property values overridden from their prefab values */
AzToolsFramework--PropertyRowWidget[IsOverridden=true] #Name QLabel,
AzToolsFramework--ComponentEditorHeader #Title[IsOverridden="true"]
@@ -35,6 +35,7 @@
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzFramework/Visibility/BoundsBus.h>
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
#include <AzToolsFramework/API/EditorEntityAPI.h>
#include <AzToolsFramework/API/EntityCompositionRequestBus.h>
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
#include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
@@ -192,6 +193,9 @@ void SandboxIntegrationManager::Setup()
(m_prefabIntegrationInterface != nullptr),
"SandboxIntegrationManager requires a PrefabIntegrationInterface instance to be present on Setup().");
m_editorEntityAPI = AZ::Interface<AzToolsFramework::EditorEntityAPI>::Get();
AZ_Assert(m_editorEntityAPI, "SandboxIntegrationManager requires an EditorEntityAPI instance to be present on Setup().");
AzToolsFramework::Layers::EditorLayerComponentNotificationBus::Handler::BusConnect();
}
@@ -1215,9 +1219,20 @@ void SandboxIntegrationManager::CloneSelection(bool& handled)
if (!duplicationSet.empty())
{
AZStd::unordered_set<AZ::EntityId> clonedEntities;
handled = AzToolsFramework::CloneInstantiatedEntities(duplicationSet, clonedEntities);
m_unsavedEntities.insert(clonedEntities.begin(), clonedEntities.end());
bool prefabSystemEnabled = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult(prefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (prefabSystemEnabled)
{
m_editorEntityAPI->DuplicateSelected();
handled = true;
}
else
{
AZStd::unordered_set<AZ::EntityId> clonedEntities;
handled = AzToolsFramework::CloneInstantiatedEntities(duplicationSet, clonedEntities);
m_unsavedEntities.insert(clonedEntities.begin(), clonedEntities.end());
}
}
else
{
@@ -77,6 +77,7 @@ class CHyperGraph;
namespace AzToolsFramework
{
class EditorEntityAPI;
class EditorEntityUiInterface;
namespace AssetBrowser
@@ -371,6 +372,7 @@ private:
AzToolsFramework::EditorEntityUiInterface* m_editorEntityUiInterface = nullptr;
AzToolsFramework::Prefab::PrefabIntegrationInterface* m_prefabIntegrationInterface = nullptr;
AzToolsFramework::EditorEntityAPI* m_editorEntityAPI = nullptr;
// Overrides UI styling and behavior for Layer Entities
AzToolsFramework::LayerUiHandler m_layerUiOverrideHandler;
@@ -65,6 +65,7 @@
#include "OutlinerTreeView.hxx"
#include "Include/ICommandManager.h"
#include "Include/IObjectManager.h"
#include "OutlinerCacheBus.h"
#include <Editor/CryEditDoc.h>
#include <AzCore/Outcome/Outcome.h>
@@ -1538,6 +1539,16 @@ void OutlinerListModel::OnEntityInfoUpdatedName(AZ::EntityId entityId, const AZS
{
(void)name;
QueueEntityUpdate(entityId);
bool isSelected = false;
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(
isSelected, &AzToolsFramework::ToolsApplicationRequests::IsSelected, entityId);
if (isSelected)
{
// Ask the system to scroll to the entity in case it is off screen after the rename
OutlinerModelNotificationBus::Broadcast(&OutlinerModelNotifications::QueueScrollToNewContent, entityId);
}
}
void OutlinerListModel::OnEntityInfoUpdatedUnsavedChanges(AZ::EntityId entityId)