Hiding the 2 Clusters during Gameplay mode

Signed-off-by: hultonha <hultonha@amazon.co.uk>
This commit is contained in:
hasareej
2021-06-09 16:42:28 +01:00
committed by hultonha
parent 6392788212
commit df0fede8d2
2 changed files with 19 additions and 0 deletions
@@ -1009,6 +1009,7 @@ namespace AzToolsFramework
ToolsApplicationNotificationBus::Handler::BusConnect();
Camera::EditorCameraNotificationBus::Handler::BusConnect();
ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusConnect(entityContextId);
EditorEntityContextNotificationBus::Handler::BusConnect();
EditorEntityVisibilityNotificationBus::Router::BusRouterConnect();
EditorEntityLockComponentNotificationBus::Router::BusRouterConnect();
EditorManipulatorCommandUndoRedoRequestBus::Handler::BusConnect(entityContextId);
@@ -1038,6 +1039,7 @@ namespace AzToolsFramework
EditorEntityLockComponentNotificationBus::Router::BusRouterDisconnect();
EditorEntityVisibilityNotificationBus::Router::BusRouterDisconnect();
ComponentModeFramework::EditorComponentModeNotificationBus::Handler::BusDisconnect();
EditorEvents::Bus::Handler::BusDisconnect();
Camera::EditorCameraNotificationBus::Handler::BusDisconnect();
ToolsApplicationNotificationBus::Handler::BusDisconnect();
EditorTransformComponentSelectionRequestBus::Handler::BusDisconnect();
@@ -3625,6 +3627,18 @@ namespace AzToolsFramework
ETCS::SetEntityLocalRotation(entityId, localRotation, m_transformChangedInternally);
}
void EditorTransformComponentSelection::OnStartPlayInEditor()
{
SetViewportUiClusterVisible(m_transformModeClusterId, false);
SetViewportUiClusterVisible(m_spaceCluster.m_spaceClusterId, false);
}
void EditorTransformComponentSelection::OnStopPlayInEditor()
{
SetViewportUiClusterVisible(m_transformModeClusterId, true);
SetViewportUiClusterVisible(m_spaceCluster.m_spaceClusterId, true);
}
namespace ETCS
{
// little raii wrapper to switch a value from true to false and back
@@ -128,6 +128,7 @@ namespace AzToolsFramework
, private ToolsApplicationNotificationBus::Handler
, private Camera::EditorCameraNotificationBus::Handler
, private ComponentModeFramework::EditorComponentModeNotificationBus::Handler
, private EditorEntityContextNotificationBus::Handler
, private EditorEntityVisibilityNotificationBus::Router
, private EditorEntityLockComponentNotificationBus::Router
, private EditorManipulatorCommandUndoRedoRequestBus::Handler
@@ -264,6 +265,10 @@ namespace AzToolsFramework
void EnteredComponentMode(const AZStd::vector<AZ::Uuid>& componentModeTypes) override;
void LeftComponentMode(const AZStd::vector<AZ::Uuid>& componentModeTypes) override;
// EditorEntityContextNotificationBus ...
void OnStartPlayInEditor() override;
void OnStopPlayInEditor() override;
// Helpers to safely interact with the TransformBus (requests).
void SetEntityWorldTranslation(AZ::EntityId entityId, const AZ::Vector3& worldTranslation);
void SetEntityLocalTranslation(AZ::EntityId entityId, const AZ::Vector3& localTranslation);