Merge branch 'development' into cmake/SPEC-7179
This commit is contained in:
@@ -497,9 +497,15 @@ void LevelEditorMenuHandler::PopulateEditMenu(ActionManager::MenuWrapper& editMe
|
||||
// Hide Selection
|
||||
editMenu.AddAction(AzToolsFramework::HideSelection);
|
||||
|
||||
// Unhide All
|
||||
// Show All
|
||||
editMenu.AddAction(AzToolsFramework::ShowAll);
|
||||
|
||||
// Lock Selection
|
||||
editMenu.AddAction(AzToolsFramework::LockSelection);
|
||||
|
||||
// UnLock All
|
||||
editMenu.AddAction(AzToolsFramework::UnlockAll);
|
||||
|
||||
/*
|
||||
* The following block of code is part of the feature "Isolation Mode" and is temporarily
|
||||
* disabled for 1.10 release.
|
||||
|
||||
@@ -1896,7 +1896,7 @@ void EditorViewportWidget::SetViewTM(const Matrix34& viewTM, bool bMoveOnly)
|
||||
|
||||
if (m_pressedKeyState != KeyPressedState::PressedInPreviousFrame)
|
||||
{
|
||||
CUndo undo("Move Camera");
|
||||
AzToolsFramework::ScopedUndoBatch undo("Move Camera");
|
||||
if (bMoveOnly)
|
||||
{
|
||||
// specify eObjectUpdateFlags_UserInput so that an undo command gets logged
|
||||
@@ -1932,7 +1932,7 @@ void EditorViewportWidget::SetViewTM(const Matrix34& viewTM, bool bMoveOnly)
|
||||
|
||||
if (m_pressedKeyState != KeyPressedState::PressedInPreviousFrame)
|
||||
{
|
||||
CUndo undo("Move Camera");
|
||||
AzToolsFramework::ScopedUndoBatch undo("Move Camera");
|
||||
if (bMoveOnly)
|
||||
{
|
||||
AZ::TransformBus::Event(
|
||||
@@ -1945,6 +1945,8 @@ void EditorViewportWidget::SetViewTM(const Matrix34& viewTM, bool bMoveOnly)
|
||||
m_viewEntityId, &AZ::TransformInterface::SetWorldTM,
|
||||
LYTransformToAZTransform(camMatrix));
|
||||
}
|
||||
|
||||
AzToolsFramework::ToolsApplicationRequestBus::Broadcast(&AzToolsFramework::ToolsApplicationRequests::AddDirtyEntity, m_viewEntityId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -83,9 +83,9 @@ AZ::RPI::ViewportContextPtr LegacyViewportCameraControllerInstance::GetViewportC
|
||||
}
|
||||
|
||||
bool LegacyViewportCameraControllerInstance::HandleMouseMove(
|
||||
const AzFramework::ScreenPoint& currentMousePos, const AzFramework::ScreenPoint& previousMousePos)
|
||||
int dx, int dy)
|
||||
{
|
||||
if (previousMousePos == currentMousePos)
|
||||
if (dx == 0 && dy == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ bool LegacyViewportCameraControllerInstance::HandleMouseMove(
|
||||
|
||||
if (m_inMoveMode || m_inOrbitMode || m_inRotateMode || m_inZoomMode)
|
||||
{
|
||||
m_totalMouseMoveDelta += (QPoint(currentMousePos.m_x, currentMousePos.m_y)-QPoint(previousMousePos.m_x, previousMousePos.m_y)).manhattanLength();
|
||||
m_totalMouseMoveDelta += AZStd::abs(dx) + AZStd::abs(dy);
|
||||
}
|
||||
|
||||
if ((m_inRotateMode && m_inMoveMode) || m_inZoomMode)
|
||||
@@ -115,7 +115,7 @@ bool LegacyViewportCameraControllerInstance::HandleMouseMove(
|
||||
Vec3 ydir = m.GetColumn1().GetNormalized();
|
||||
Vec3 pos = m.GetTranslation();
|
||||
|
||||
const float posDelta = 0.2f * (previousMousePos.m_y - currentMousePos.m_y) * speedScale;
|
||||
const float posDelta = 0.2f * dy * speedScale;
|
||||
pos = pos - ydir * posDelta;
|
||||
m_orbitDistance = m_orbitDistance + posDelta;
|
||||
m_orbitDistance = fabs(m_orbitDistance);
|
||||
@@ -126,7 +126,7 @@ bool LegacyViewportCameraControllerInstance::HandleMouseMove(
|
||||
}
|
||||
else if (m_inRotateMode)
|
||||
{
|
||||
Ang3 angles(-currentMousePos.m_y + previousMousePos.m_y, 0, -currentMousePos.m_x + previousMousePos.m_x);
|
||||
Ang3 angles(dy, 0, dx);
|
||||
angles = angles * 0.002f * gSettings.cameraRotateSpeed;
|
||||
if (gSettings.invertYRotation)
|
||||
{
|
||||
@@ -158,7 +158,7 @@ bool LegacyViewportCameraControllerInstance::HandleMouseMove(
|
||||
}
|
||||
|
||||
Vec3 pos = m.GetTranslation();
|
||||
pos += 0.1f * xdir * (currentMousePos.m_x - previousMousePos.m_x) * speedScale + 0.1f * zdir * (previousMousePos.m_y - currentMousePos.m_y) * speedScale;
|
||||
pos += 0.1f * xdir * dx * speedScale + 0.1f * zdir * dy * speedScale;
|
||||
m.SetTranslation(pos);
|
||||
|
||||
AZ::Transform transform = viewportContext->GetCameraTransform();
|
||||
@@ -168,7 +168,7 @@ bool LegacyViewportCameraControllerInstance::HandleMouseMove(
|
||||
}
|
||||
else if (m_inOrbitMode)
|
||||
{
|
||||
Ang3 angles(-currentMousePos.m_y + previousMousePos.m_y, 0, -currentMousePos.m_x + previousMousePos.m_x);
|
||||
Ang3 angles(dy, 0, dx);
|
||||
angles = angles * 0.002f * gSettings.cameraRotateSpeed;
|
||||
|
||||
if (gSettings.invertPan)
|
||||
@@ -302,20 +302,19 @@ bool LegacyViewportCameraControllerInstance::HandleInputChannelEvent(const AzFra
|
||||
bool shouldCaptureCursor = m_capturingCursor;
|
||||
bool shouldConsumeEvent = false;
|
||||
|
||||
if (id == AzFramework::InputDeviceMouse::SystemCursorPosition)
|
||||
if (id == AzFramework::InputDeviceMouse::Movement::X || id == AzFramework::InputDeviceMouse::Movement::Y)
|
||||
{
|
||||
bool result = false;
|
||||
AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event(
|
||||
GetViewportId(),
|
||||
[this, &result](AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequests* mouseRequests)
|
||||
{
|
||||
if (auto previousMousePosition = mouseRequests->PreviousViewportCursorScreenPosition();
|
||||
previousMousePosition.has_value())
|
||||
{
|
||||
result = HandleMouseMove(mouseRequests->ViewportCursorScreenPosition(), previousMousePosition.value());
|
||||
}
|
||||
});
|
||||
return result;
|
||||
int dx = 0;
|
||||
int dy = 0;
|
||||
if (id == AzFramework::InputDeviceMouse::Movement::X)
|
||||
{
|
||||
dx = -aznumeric_cast<int>(event.m_inputChannel.GetValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
dy = -aznumeric_cast<int>(event.m_inputChannel.GetValue());
|
||||
}
|
||||
return HandleMouseMove(dx, dy);
|
||||
}
|
||||
else if (id == MouseButton::Left)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace SandboxEditor
|
||||
|
||||
AZ::RPI::ViewportContextPtr GetViewportContext();
|
||||
|
||||
bool HandleMouseMove(const AzFramework::ScreenPoint& currentMousePos, const AzFramework::ScreenPoint& previousMousePos);
|
||||
bool HandleMouseMove(int dx, int dy);
|
||||
bool HandleMouseWheel(float zDelta);
|
||||
bool IsKeyDown(Qt::Key key) const;
|
||||
void UpdateCursorCapture(bool shouldCaptureCursor);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.Amazon.Lumberyard.Editor</string>
|
||||
<string>org.O3DE.Editor</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
|
||||
@@ -46,4 +46,8 @@ ly_add_target(
|
||||
AZ::AzCore
|
||||
AZ::AzToolsFramework
|
||||
AZ::AzQtComponents
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AzCore
|
||||
AZ::AzToolsFramework
|
||||
AZ::AzQtComponents
|
||||
)
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
#include "ValidationHandler.h"
|
||||
|
||||
#include <AzCore/Component/ComponentApplicationBus.h>
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
|
||||
#include "AzToolsFramework/UI/PropertyEditor/InstanceDataHierarchy.h"
|
||||
#include <AzToolsFramework/UI/PropertyEditor/InstanceDataHierarchy.h>
|
||||
#include <AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.h>
|
||||
#include <AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.hxx>
|
||||
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
|
||||
#include <Util/FileUtil.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
@@ -52,7 +52,7 @@ namespace ProjectSettingsTool
|
||||
PlatformEnabled(PlatformId::Ios) ?
|
||||
ProjectSettingsContainer::PlistInitVector({
|
||||
ProjectSettingsContainer::PlatformAndPath
|
||||
{ PlatformId::Ios, m_projectRoot + PlatformResourcesFolder(PlatformId::Ios) }
|
||||
{ PlatformId::Ios, GetPlatformResource(PlatformId::Ios) }
|
||||
})
|
||||
:
|
||||
ProjectSettingsContainer::PlistInitVector())
|
||||
@@ -647,33 +647,38 @@ namespace ProjectSettingsTool
|
||||
// iOS can be disabled if the plist file is missing
|
||||
if (platformId == PlatformId::Ios)
|
||||
{
|
||||
const AZStd::string filename = m_projectRoot + PlatformResourcesFolder(platformId);
|
||||
return CFileUtil::FileExists(filename.c_str());
|
||||
AZStd::string plistPath = GetPlatformResource(platformId);
|
||||
return !plistPath.empty();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* ProjectSettingsToolWindow::PlatformResourcesFolder(PlatformId platformId)
|
||||
AZStd::string ProjectSettingsToolWindow::GetPlatformResource(PlatformId platformId)
|
||||
{
|
||||
if (platformId == PlatformId::Ios)
|
||||
{
|
||||
const AZStd::string firstfilename = m_projectRoot + "/Gem/Resources/Platform/iOS/Info.plist";
|
||||
if (CFileUtil::FileExists(firstfilename.c_str()))
|
||||
const char* searchPaths[] = {
|
||||
"Resources/Platform/iOS/Info.plist",
|
||||
|
||||
// legacy paths
|
||||
"Gem/Resources/Platform/iOS/Info.plist",
|
||||
"Gem/Resources/IOSLauncher/Info.plist",
|
||||
};
|
||||
|
||||
for (auto relPath : searchPaths)
|
||||
{
|
||||
return "/Gem/Resources/Platform/iOS/Info.plist";
|
||||
}
|
||||
else
|
||||
{
|
||||
const AZStd::string filename = m_projectRoot + "/Gem/Resources/IOSLauncher/Info.plist";
|
||||
if (CFileUtil::FileExists(filename.c_str()))
|
||||
AZ::IO::FixedMaxPath projectPlist{ m_projectRoot };
|
||||
projectPlist /= relPath;
|
||||
|
||||
if (AZ::IO::SystemFile::Exists(projectPlist.c_str()))
|
||||
{
|
||||
return "/Gem/Resources/IOSLauncher/Info.plist";
|
||||
return projectPlist.LexicallyNormal().String();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return AZStd::string();
|
||||
}
|
||||
|
||||
#include <moc_ProjectSettingsToolWindow.cpp>
|
||||
|
||||
@@ -137,8 +137,8 @@ namespace ProjectSettingsTool
|
||||
// returns true if the platform is enabled
|
||||
bool PlatformEnabled(PlatformId platformId);
|
||||
|
||||
// returns the resource folder
|
||||
const char* PlatformResourcesFolder(PlatformId platformId);
|
||||
// returns the main platform specific resource file e.g. for iOS it would be the Info.plist
|
||||
AZStd::string GetPlatformResource(PlatformId platformId);
|
||||
|
||||
// The ui for the window
|
||||
QScopedPointer<Ui::ProjectSettingsToolWidget> m_ui;
|
||||
|
||||
Reference in New Issue
Block a user