Merge branch 'develop' into LYN-1767-AB
This commit is contained in:
@@ -117,6 +117,8 @@ void AssetEditorWindow::RegisterViewClass()
|
||||
{
|
||||
AzToolsFramework::ViewPaneOptions options;
|
||||
options.preferedDockingArea = Qt::LeftDockWidgetArea;
|
||||
options.showOnToolsToolbar = true;
|
||||
options.toolbarIcon = ":/Menu/asset_editor.svg";
|
||||
AzToolsFramework::RegisterViewPane<AssetEditorWindow>(LyViewPane::AssetEditor, LyViewPane::CategoryTools, options);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/Platform/${PAL_PLATFORM_NAME}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
|
||||
|
||||
ly_add_target(
|
||||
NAME EditorCore SHARED
|
||||
NAMESPACE Legacy
|
||||
@@ -161,7 +159,7 @@ ly_add_source_properties(
|
||||
# Editor
|
||||
################################################################################
|
||||
ly_add_target(
|
||||
NAME Editor ${PAL_TRAIT_BUILD_EDITOR_APPLICATION_TYPE} # Mac Editor is a bare executable on Atom until we can fix packaging of the shader compilers. DO NOT MERGE BACK TO MAINLINE
|
||||
NAME Editor APPLICATION
|
||||
NAMESPACE Legacy
|
||||
AUTORCC
|
||||
FILES_CMAKE
|
||||
|
||||
@@ -715,11 +715,11 @@ QMenu* LevelEditorMenuHandler::CreateViewMenu()
|
||||
{
|
||||
return view.IsViewportPane();
|
||||
});
|
||||
#endif
|
||||
|
||||
viewportViewsMenuWrapper.AddAction(ID_WIREFRAME);
|
||||
viewportViewsMenuWrapper.AddSeparator();
|
||||
|
||||
#endif
|
||||
|
||||
if (CViewManager::IsMultiViewportEnabled())
|
||||
{
|
||||
viewportViewsMenuWrapper.AddAction(ID_VIEW_CONFIGURELAYOUT);
|
||||
@@ -759,11 +759,6 @@ QMenu* LevelEditorMenuHandler::CreateViewMenu()
|
||||
|
||||
viewportViewsMenuWrapper.AddSeparator();
|
||||
|
||||
auto changeMoveSpeedMenu = viewportViewsMenuWrapper.AddMenu(tr("Change Move Speed"));
|
||||
changeMoveSpeedMenu.AddAction(ID_CHANGEMOVESPEED_INCREASE);
|
||||
changeMoveSpeedMenu.AddAction(ID_CHANGEMOVESPEED_DECREASE);
|
||||
changeMoveSpeedMenu.AddAction(ID_CHANGEMOVESPEED_CHANGESTEP);
|
||||
|
||||
auto switchCameraMenu = viewportViewsMenuWrapper.AddMenu(tr("Switch Camera"));
|
||||
switchCameraMenu.AddAction(ID_SWITCHCAMERA_DEFAULTCAMERA);
|
||||
switchCameraMenu.AddAction(ID_SWITCHCAMERA_SEQUENCECAMERA);
|
||||
@@ -1292,7 +1287,7 @@ void LevelEditorMenuHandler::AddEditMenuAction(QAction* action)
|
||||
}
|
||||
}
|
||||
|
||||
void LevelEditorMenuHandler::AddMenuAction(AZStd::string_view categoryId, QAction* action)
|
||||
void LevelEditorMenuHandler::AddMenuAction(AZStd::string_view categoryId, QAction* action, bool addToToolsToolbar)
|
||||
{
|
||||
auto menuWrapper = m_actionManager->FindMenu(categoryId.data());
|
||||
if (menuWrapper.isNull())
|
||||
@@ -1301,6 +1296,11 @@ void LevelEditorMenuHandler::AddMenuAction(AZStd::string_view categoryId, QActio
|
||||
return;
|
||||
}
|
||||
menuWrapper.Get()->addAction(action);
|
||||
|
||||
if (addToToolsToolbar)
|
||||
{
|
||||
m_mainWindow->GetToolbarManager()->AddButtonToEditToolbar(action);
|
||||
}
|
||||
}
|
||||
|
||||
void LevelEditorMenuHandler::RestoreEditMenuToDefault()
|
||||
|
||||
@@ -98,7 +98,7 @@ private:
|
||||
|
||||
// EditorMenuRequestBus
|
||||
void AddEditMenuAction(QAction* action) override;
|
||||
void AddMenuAction(AZStd::string_view categoryId, QAction* action) override;
|
||||
void AddMenuAction(AZStd::string_view categoryId, QAction* action, bool addToToolsToolbar) override;
|
||||
void RestoreEditMenuToDefault() override;
|
||||
|
||||
MainWindow* m_mainWindow;
|
||||
|
||||
@@ -400,8 +400,6 @@ void CCryEditApp::RegisterActionHandlers()
|
||||
ON_COMMAND(ID_GAME_SYNCPLAYER, OnSyncPlayer)
|
||||
ON_COMMAND(ID_RESOURCES_REDUCEWORKINGSET, OnResourcesReduceworkingset)
|
||||
|
||||
ON_COMMAND(ID_WIREFRAME, OnWireframe)
|
||||
|
||||
ON_COMMAND(ID_VIEW_CONFIGURELAYOUT, OnViewConfigureLayout)
|
||||
|
||||
ON_COMMAND(IDC_SELECTION, OnDummyCommand)
|
||||
@@ -441,9 +439,6 @@ void CCryEditApp::RegisterActionHandlers()
|
||||
ON_COMMAND(ID_VIEW_CYCLE2DVIEWPORT, OnViewCycle2dviewport)
|
||||
#endif
|
||||
ON_COMMAND(ID_DISPLAY_GOTOPOSITION, OnDisplayGotoPosition)
|
||||
ON_COMMAND(ID_CHANGEMOVESPEED_INCREASE, OnChangemovespeedIncrease)
|
||||
ON_COMMAND(ID_CHANGEMOVESPEED_DECREASE, OnChangemovespeedDecrease)
|
||||
ON_COMMAND(ID_CHANGEMOVESPEED_CHANGESTEP, OnChangemovespeedChangestep)
|
||||
ON_COMMAND(ID_FILE_SAVELEVELRESOURCES, OnFileSavelevelresources)
|
||||
ON_COMMAND(ID_CLEAR_REGISTRY, OnClearRegistryData)
|
||||
ON_COMMAND(ID_VALIDATELEVEL, OnValidatelevel)
|
||||
@@ -2891,7 +2886,7 @@ void CCryEditApp::OpenProjectManager(const AZStd::string& screen)
|
||||
{
|
||||
// provide the current project path for in case we want to update the project
|
||||
AZ::IO::FixedMaxPathString projectPath = AZ::Utils::GetProjectPath();
|
||||
const AZStd::string commandLineOptions = AZStd::string::format(" --screen %s --project_path %s", screen.c_str(), projectPath.c_str());
|
||||
const AZStd::string commandLineOptions = AZStd::string::format(" --screen %s --project-path %s", screen.c_str(), projectPath.c_str());
|
||||
bool launchSuccess = AzFramework::ProjectManager::LaunchProjectManager(commandLineOptions);
|
||||
if (!launchSuccess)
|
||||
{
|
||||
@@ -3466,31 +3461,6 @@ void CCryEditApp::OnResourcesReduceworkingset()
|
||||
#endif
|
||||
}
|
||||
|
||||
void CCryEditApp::OnWireframe()
|
||||
{
|
||||
int nWireframe(R_SOLID_MODE);
|
||||
ICVar* r_wireframe(gEnv->pConsole->GetCVar("r_wireframe"));
|
||||
|
||||
if (r_wireframe)
|
||||
{
|
||||
nWireframe = r_wireframe->GetIVal();
|
||||
}
|
||||
|
||||
if (nWireframe != R_WIREFRAME_MODE)
|
||||
{
|
||||
nWireframe = R_WIREFRAME_MODE;
|
||||
}
|
||||
else
|
||||
{
|
||||
nWireframe = R_SOLID_MODE;
|
||||
}
|
||||
|
||||
if (r_wireframe)
|
||||
{
|
||||
r_wireframe->Set(nWireframe);
|
||||
}
|
||||
}
|
||||
|
||||
void CCryEditApp::OnUpdateWireframe(QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
@@ -3702,40 +3672,8 @@ void CCryEditApp::OnViewCycle2dviewport()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnDisplayGotoPosition()
|
||||
{
|
||||
CGotoPositionDlg dlg;
|
||||
dlg.exec();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnChangemovespeedIncrease()
|
||||
{
|
||||
gSettings.cameraMoveSpeed += m_moveSpeedStep;
|
||||
if (gSettings.cameraMoveSpeed < 0.01f)
|
||||
{
|
||||
gSettings.cameraMoveSpeed = 0.01f;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnChangemovespeedDecrease()
|
||||
{
|
||||
gSettings.cameraMoveSpeed -= m_moveSpeedStep;
|
||||
if (gSettings.cameraMoveSpeed < 0.01f)
|
||||
{
|
||||
gSettings.cameraMoveSpeed = 0.01f;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnChangemovespeedChangestep()
|
||||
{
|
||||
bool ok = false;
|
||||
int fractionalDigitCount = 5;
|
||||
float step = aznumeric_caster(QInputDialog::getDouble(AzToolsFramework::GetActiveWindow(), QObject::tr("Change Move Increase/Decrease Step"), QStringLiteral(""), m_moveSpeedStep, std::numeric_limits<float>::lowest(), std::numeric_limits<float>::max(), fractionalDigitCount, &ok));
|
||||
if (ok)
|
||||
{
|
||||
m_moveSpeedStep = step;
|
||||
}
|
||||
GotoPositionDialog dialog;
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -372,7 +372,6 @@ private:
|
||||
friend struct PythonTestOutputHandler;
|
||||
|
||||
void OpenProjectManager(const AZStd::string& screen);
|
||||
void OnWireframe();
|
||||
void OnUpdateWireframe(QAction* action);
|
||||
void OnViewConfigureLayout();
|
||||
|
||||
@@ -408,9 +407,6 @@ private:
|
||||
void OnToolsScriptHelp();
|
||||
void OnViewCycle2dviewport();
|
||||
void OnDisplayGotoPosition();
|
||||
void OnChangemovespeedIncrease();
|
||||
void OnChangemovespeedDecrease();
|
||||
void OnChangemovespeedChangestep();
|
||||
void OnFileSavelevelresources();
|
||||
void OnClearRegistryData();
|
||||
void OnValidatelevel();
|
||||
|
||||
@@ -729,6 +729,9 @@ bool CCryEditDoc::SaveModified()
|
||||
void CCryEditDoc::OnFileSaveAs()
|
||||
{
|
||||
CLevelFileDialog levelFileDialog(false);
|
||||
levelFileDialog.show();
|
||||
levelFileDialog.adjustSize();
|
||||
|
||||
if (levelFileDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
if (OnSaveDocument(levelFileDialog.GetFileName()))
|
||||
@@ -1136,7 +1139,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
|
||||
const QString oldLevelPattern = QDir(oldLevelFolder).absoluteFilePath("*.*");
|
||||
const QString oldLevelName = Path::GetFile(GetLevelPathName());
|
||||
const QString oldLevelXml = Path::ReplaceExtension(oldLevelName, "xml");
|
||||
AZ::IO::ArchiveFileIterator findHandle = pIPak->FindFirst(oldLevelPattern.toUtf8().data(), 0, true);
|
||||
AZ::IO::ArchiveFileIterator findHandle = pIPak->FindFirst(oldLevelPattern.toUtf8().data(), AZ::IO::IArchive::eFileSearchType_AllowOnDiskAndInZips);
|
||||
if (findHandle)
|
||||
{
|
||||
do
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "GameEngine.h"
|
||||
#include "UndoConfigSpec.h"
|
||||
#include "ViewManager.h"
|
||||
#include "EditorViewportCamera.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
namespace
|
||||
@@ -241,26 +242,15 @@ namespace
|
||||
|
||||
void PySetCurrentViewPosition(float x, float y, float z)
|
||||
{
|
||||
AzToolsFramework::IEditorCameraController* editorCameraController = AZ::Interface<AzToolsFramework::IEditorCameraController>::Get();
|
||||
AZ_Error("editor", editorCameraController, "IEditorCameraController is not registered.");
|
||||
if (editorCameraController)
|
||||
{
|
||||
editorCameraController->SetCurrentViewPosition(AZ::Vector3{ x, y, z });
|
||||
}
|
||||
SandboxEditor::SetDefaultViewportCameraPosition(AZ::Vector3(x, y, z));
|
||||
}
|
||||
|
||||
void PySetCurrentViewRotation(float x, float y, float z)
|
||||
void PySetCurrentViewRotation(float x, [[maybe_unused]] float y, float z)
|
||||
{
|
||||
AzToolsFramework::IEditorCameraController* editorCameraController = AZ::Interface<AzToolsFramework::IEditorCameraController>::Get();
|
||||
AZ_Error("editor", editorCameraController, "IEditorCameraController is not registered.");
|
||||
if (editorCameraController)
|
||||
{
|
||||
editorCameraController->SetCurrentViewRotation(AZ::Vector3{ x, y, z });
|
||||
}
|
||||
SandboxEditor::SetDefaultViewportCameraRotation(AZ::DegToRad(x), AZ::DegToRad(z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
void PyStartProcessDetached(const char* process, const char* args)
|
||||
@@ -488,9 +478,9 @@ namespace AzToolsFramework
|
||||
|
||||
addLegacyGeneral(behaviorContext->Method("load_all_plugins", ::Command_LoadPlugins, nullptr, "Loads all available plugins."));
|
||||
addLegacyGeneral(behaviorContext->Method("get_current_view_position", PyGetCurrentViewPosition, nullptr, "Returns the position of the current view as a Vec3."));
|
||||
addLegacyGeneral(behaviorContext->Method("get_current_view_rotation", PyGetCurrentViewRotation, nullptr, "Returns the rotation of the current view as a Vec3 of Euler angles."));
|
||||
addLegacyGeneral(behaviorContext->Method("get_current_view_rotation", PyGetCurrentViewRotation, nullptr, "Returns the rotation of the current view as a Vec3 of Euler angles in degrees."));
|
||||
addLegacyGeneral(behaviorContext->Method("set_current_view_position", PySetCurrentViewPosition, nullptr, "Sets the position of the current view as given x, y, z coordinates."));
|
||||
addLegacyGeneral(behaviorContext->Method("set_current_view_rotation", PySetCurrentViewRotation, nullptr, "Sets the rotation of the current view as given x, y, z Euler angles."));
|
||||
addLegacyGeneral(behaviorContext->Method("set_current_view_rotation", PySetCurrentViewRotation, nullptr, "Sets the rotation of the current view as given x, y, z Euler angles in degrees."));
|
||||
|
||||
addLegacyGeneral(behaviorContext->Method("export_to_engine", CCryEditApp::Command_ExportToEngine, nullptr, "Exports the current level to the engine."));
|
||||
addLegacyGeneral(behaviorContext->Method("set_config_spec", PySetConfigSpec, nullptr, "Sets the system config spec and platform."));
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
// Editor
|
||||
#include "Settings.h"
|
||||
|
||||
#include "EditorViewportSettings.h"
|
||||
|
||||
void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& serialize)
|
||||
{
|
||||
@@ -72,20 +72,45 @@ QIcon& CEditorPreferencesPage_ViewportMovement::GetIcon()
|
||||
|
||||
void CEditorPreferencesPage_ViewportMovement::OnApply()
|
||||
{
|
||||
gSettings.cameraMoveSpeed = m_cameraMovementSettings.m_moveSpeed;
|
||||
gSettings.cameraRotateSpeed = m_cameraMovementSettings.m_rotateSpeed;
|
||||
gSettings.cameraFastMoveSpeed = m_cameraMovementSettings.m_fastMoveSpeed;
|
||||
gSettings.wheelZoomSpeed = m_cameraMovementSettings.m_wheelZoomSpeed;
|
||||
gSettings.invertYRotation = m_cameraMovementSettings.m_invertYRotation;
|
||||
gSettings.invertPan = m_cameraMovementSettings.m_invertPan;
|
||||
if (SandboxEditor::UsingNewCameraSystem())
|
||||
{
|
||||
SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_moveSpeed);
|
||||
SandboxEditor::SetCameraRotateSpeed(m_cameraMovementSettings.m_rotateSpeed);
|
||||
SandboxEditor::SetCameraBoostMultiplier(m_cameraMovementSettings.m_fastMoveSpeed);
|
||||
SandboxEditor::SetCameraScrollSpeed(m_cameraMovementSettings.m_wheelZoomSpeed);
|
||||
SandboxEditor::SetCameraOrbitYawRotationInverted(m_cameraMovementSettings.m_invertYRotation);
|
||||
SandboxEditor::SetCameraPanInvertedX(m_cameraMovementSettings.m_invertPan);
|
||||
SandboxEditor::SetCameraPanInvertedY(m_cameraMovementSettings.m_invertPan);
|
||||
}
|
||||
else
|
||||
{
|
||||
gSettings.cameraMoveSpeed = m_cameraMovementSettings.m_moveSpeed;
|
||||
gSettings.cameraRotateSpeed = m_cameraMovementSettings.m_rotateSpeed;
|
||||
gSettings.cameraFastMoveSpeed = m_cameraMovementSettings.m_fastMoveSpeed;
|
||||
gSettings.wheelZoomSpeed = m_cameraMovementSettings.m_wheelZoomSpeed;
|
||||
gSettings.invertYRotation = m_cameraMovementSettings.m_invertYRotation;
|
||||
gSettings.invertPan = m_cameraMovementSettings.m_invertPan;
|
||||
}
|
||||
}
|
||||
|
||||
void CEditorPreferencesPage_ViewportMovement::InitializeSettings()
|
||||
{
|
||||
m_cameraMovementSettings.m_moveSpeed = gSettings.cameraMoveSpeed;
|
||||
m_cameraMovementSettings.m_rotateSpeed = gSettings.cameraRotateSpeed;
|
||||
m_cameraMovementSettings.m_fastMoveSpeed = gSettings.cameraFastMoveSpeed;
|
||||
m_cameraMovementSettings.m_wheelZoomSpeed = gSettings.wheelZoomSpeed;
|
||||
m_cameraMovementSettings.m_invertYRotation = gSettings.invertYRotation;
|
||||
m_cameraMovementSettings.m_invertPan = gSettings.invertPan;
|
||||
if (SandboxEditor::UsingNewCameraSystem())
|
||||
{
|
||||
m_cameraMovementSettings.m_moveSpeed = SandboxEditor::CameraTranslateSpeed();
|
||||
m_cameraMovementSettings.m_rotateSpeed = SandboxEditor::CameraRotateSpeed();
|
||||
m_cameraMovementSettings.m_fastMoveSpeed = SandboxEditor::CameraBoostMultiplier();
|
||||
m_cameraMovementSettings.m_wheelZoomSpeed = SandboxEditor::CameraScrollSpeed();
|
||||
m_cameraMovementSettings.m_invertYRotation = SandboxEditor::CameraOrbitYawRotationInverted();
|
||||
m_cameraMovementSettings.m_invertPan = SandboxEditor::CameraPanInvertedX() && SandboxEditor::CameraPanInvertedY();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_cameraMovementSettings.m_moveSpeed = gSettings.cameraMoveSpeed;
|
||||
m_cameraMovementSettings.m_rotateSpeed = gSettings.cameraRotateSpeed;
|
||||
m_cameraMovementSettings.m_fastMoveSpeed = gSettings.cameraFastMoveSpeed;
|
||||
m_cameraMovementSettings.m_wheelZoomSpeed = gSettings.wheelZoomSpeed;
|
||||
m_cameraMovementSettings.m_invertYRotation = gSettings.invertYRotation;
|
||||
m_cameraMovementSettings.m_invertPan = gSettings.invertPan;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <EditorViewportCamera.h>
|
||||
|
||||
#include <Atom/RPI.Public/ViewportContext.h>
|
||||
#include <Atom/RPI.Public/ViewportContextBus.h>
|
||||
|
||||
namespace SandboxEditor
|
||||
{
|
||||
void SetDefaultViewportCameraPosition(const AZ::Vector3& position)
|
||||
{
|
||||
auto viewportContextManager = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
|
||||
if (auto viewportContext = viewportContextManager->GetDefaultViewportContext())
|
||||
{
|
||||
const auto& currentCameraTransform = viewportContext->GetCameraTransform();
|
||||
viewportContext->SetCameraTransform(
|
||||
AZ::Transform::CreateFromQuaternionAndTranslation(currentCameraTransform.GetRotation(), position));
|
||||
}
|
||||
}
|
||||
|
||||
void SetDefaultViewportCameraRotation(const float pitch, const float yaw)
|
||||
{
|
||||
auto viewportContextManager = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
|
||||
if (auto viewportContext = viewportContextManager->GetDefaultViewportContext())
|
||||
{
|
||||
const auto rotation = AZ::Quaternion::CreateRotationZ(yaw) * AZ::Quaternion::CreateRotationX(pitch);
|
||||
const auto& currentCameraTransform = viewportContext->GetCameraTransform();
|
||||
viewportContext->SetCameraTransform(
|
||||
AZ::Transform::CreateFromQuaternionAndTranslation(rotation, currentCameraTransform.GetTranslation()));
|
||||
}
|
||||
}
|
||||
|
||||
AZ::Transform GetDefaultViewportCameraTransform()
|
||||
{
|
||||
auto viewportContextManager = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
|
||||
if (auto viewportContext = viewportContextManager->GetDefaultViewportContext())
|
||||
{
|
||||
return viewportContext->GetCameraTransform();
|
||||
}
|
||||
|
||||
AZ_WarningOnce("EditorViewport", false, "Default viewport camera not found");
|
||||
|
||||
return AZ::Transform::CreateIdentity();
|
||||
}
|
||||
} // namespace SandboxEditor
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <SandboxAPI.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
class Transform;
|
||||
class Vector3;
|
||||
} // namespace AZ
|
||||
|
||||
namespace SandboxEditor
|
||||
{
|
||||
//! Set the default viewport camera translation/position.
|
||||
SANDBOX_API void SetDefaultViewportCameraPosition(const AZ::Vector3& position);
|
||||
|
||||
//! Set the default viewport camera orientation/rotation.
|
||||
//! @param pitch Amount of pitch in radians.
|
||||
//! @param yaw Amount of yaw in radians.
|
||||
SANDBOX_API void SetDefaultViewportCameraRotation(float pitch, float yaw);
|
||||
|
||||
//! Get the default viewport camera transform.
|
||||
SANDBOX_API AZ::Transform GetDefaultViewportCameraTransform();
|
||||
} // namespace SandboxEditor
|
||||
@@ -23,94 +23,196 @@ namespace SandboxEditor
|
||||
constexpr AZStd::string_view AngleSnappingSetting = "/Amazon/Preferences/Editor/AngleSnapping";
|
||||
constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize";
|
||||
constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid";
|
||||
constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed";
|
||||
constexpr AZStd::string_view CameraBoostMultiplierSetting = "/Amazon/Preferences/Editor/Camera/BoostMultiplier";
|
||||
constexpr AZStd::string_view CameraRotateSpeedSetting = "/Amazon/Preferences/Editor/Camera/RotateSpeed";
|
||||
constexpr AZStd::string_view CameraScrollSpeedSetting = "/Amazon/Preferences/Editor/Camera/DollyScrollSpeed";
|
||||
constexpr AZStd::string_view CameraDollyMotionSpeedSetting = "/Amazon/Preferences/Editor/Camera/DollyMotionSpeed";
|
||||
constexpr AZStd::string_view CameraOrbitYawRotationInvertedSetting = "/Amazon/Preferences/Editor/Camera/YawRotationInverted";
|
||||
constexpr AZStd::string_view CameraPanInvertedXSetting = "/Amazon/Preferences/Editor/Camera/PanInvertedX";
|
||||
constexpr AZStd::string_view CameraPanInvertedYSetting = "/Amazon/Preferences/Editor/Camera/PanInvertedY";
|
||||
constexpr AZStd::string_view CameraPanSpeedSetting = "/Amazon/Preferences/Editor/Camera/PanSpeed";
|
||||
constexpr AZStd::string_view CameraRotateSmoothnessSetting = "/Amazon/Preferences/Editor/Camera/RotateSmoothness";
|
||||
constexpr AZStd::string_view CameraTranslateSmoothnessSetting = "/Amazon/Preferences/Editor/Camera/TranslateSmoothness";
|
||||
|
||||
template<typename T>
|
||||
void SetRegistry(const AZStd::string_view setting, T&& value)
|
||||
{
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Set(setting, AZStd::forward<T>(value));
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
AZStd::remove_cvref_t<T> GetRegistry(const AZStd::string_view setting, T&& defaultValue)
|
||||
{
|
||||
AZStd::remove_cvref_t<T> value = AZStd::forward<T>(defaultValue);
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Get(value, setting);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
bool GridSnappingEnabled()
|
||||
{
|
||||
bool enabled = false;
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Get(enabled, GridSnappingSetting);
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
|
||||
float GridSnappingSize()
|
||||
{
|
||||
double gridSize = 0.1;
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Get(gridSize, GridSizeSetting);
|
||||
}
|
||||
return aznumeric_cast<float>(gridSize);
|
||||
}
|
||||
|
||||
bool AngleSnappingEnabled()
|
||||
{
|
||||
bool enabled = false;
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Get(enabled, AngleSnappingSetting);
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
|
||||
float AngleSnappingSize()
|
||||
{
|
||||
double angleSize = 5.0;
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Get(angleSize, AngleSizeSetting);
|
||||
}
|
||||
return aznumeric_cast<float>(angleSize);
|
||||
}
|
||||
|
||||
bool ShowingGrid()
|
||||
{
|
||||
bool enabled = false;
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Get(enabled, ShowGridSetting);
|
||||
}
|
||||
return enabled;
|
||||
return GetRegistry(GridSnappingSetting, false);
|
||||
}
|
||||
|
||||
void SetGridSnapping(const bool enabled)
|
||||
{
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Set(GridSnappingSetting, enabled);
|
||||
}
|
||||
SetRegistry(GridSnappingSetting, enabled);
|
||||
}
|
||||
|
||||
float GridSnappingSize()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(GridSizeSetting, 0.1));
|
||||
}
|
||||
|
||||
void SetGridSnappingSize(const float size)
|
||||
{
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Set(GridSizeSetting, size);
|
||||
}
|
||||
SetRegistry(GridSizeSetting, size);
|
||||
}
|
||||
|
||||
bool AngleSnappingEnabled()
|
||||
{
|
||||
return GetRegistry(AngleSnappingSetting, false);
|
||||
}
|
||||
|
||||
void SetAngleSnapping(const bool enabled)
|
||||
{
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Set(AngleSnappingSetting, enabled);
|
||||
}
|
||||
SetRegistry(AngleSnappingSetting, enabled);
|
||||
}
|
||||
|
||||
float AngleSnappingSize()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(AngleSizeSetting, 5.0));
|
||||
}
|
||||
|
||||
void SetAngleSnappingSize(const float size)
|
||||
{
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Set(AngleSizeSetting, size);
|
||||
}
|
||||
SetRegistry(AngleSizeSetting, size);
|
||||
}
|
||||
|
||||
bool ShowingGrid()
|
||||
{
|
||||
return GetRegistry(ShowGridSetting, false);
|
||||
}
|
||||
|
||||
void SetShowingGrid(const bool showing)
|
||||
{
|
||||
if (auto* registry = AZ::SettingsRegistry::Get())
|
||||
{
|
||||
registry->Set(ShowGridSetting, showing);
|
||||
}
|
||||
SetRegistry(ShowGridSetting, showing);
|
||||
}
|
||||
|
||||
float CameraTranslateSpeed()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(CameraTranslateSpeedSetting, 10.0));
|
||||
}
|
||||
|
||||
void SetCameraTranslateSpeed(const float speed)
|
||||
{
|
||||
SetRegistry(CameraTranslateSpeedSetting, speed);
|
||||
}
|
||||
|
||||
float CameraBoostMultiplier()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(CameraBoostMultiplierSetting, 3.0));
|
||||
}
|
||||
|
||||
void SetCameraBoostMultiplier(const float multiplier)
|
||||
{
|
||||
SetRegistry(CameraBoostMultiplierSetting, multiplier);
|
||||
}
|
||||
|
||||
float CameraRotateSpeed()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(CameraRotateSpeedSetting, 0.005));
|
||||
}
|
||||
|
||||
void SetCameraRotateSpeed(const float speed)
|
||||
{
|
||||
SetRegistry(CameraRotateSpeedSetting, speed);
|
||||
}
|
||||
|
||||
float CameraScrollSpeed()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(CameraScrollSpeedSetting, 0.02));
|
||||
}
|
||||
|
||||
void SetCameraScrollSpeed(const float speed)
|
||||
{
|
||||
SetRegistry(CameraScrollSpeedSetting, speed);
|
||||
}
|
||||
|
||||
float CameraDollyMotionSpeed()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(CameraDollyMotionSpeedSetting, 0.01));
|
||||
}
|
||||
|
||||
void SetCameraDollyMotionSpeed(const float speed)
|
||||
{
|
||||
SetRegistry(CameraDollyMotionSpeedSetting, speed);
|
||||
}
|
||||
|
||||
bool CameraOrbitYawRotationInverted()
|
||||
{
|
||||
return GetRegistry(CameraOrbitYawRotationInvertedSetting, false);
|
||||
}
|
||||
|
||||
void SetCameraOrbitYawRotationInverted(const bool inverted)
|
||||
{
|
||||
SetRegistry(CameraOrbitYawRotationInvertedSetting, inverted);
|
||||
}
|
||||
|
||||
bool CameraPanInvertedX()
|
||||
{
|
||||
return GetRegistry(CameraPanInvertedXSetting, true);
|
||||
}
|
||||
|
||||
void SetCameraPanInvertedX(const bool inverted)
|
||||
{
|
||||
SetRegistry(CameraPanInvertedXSetting, inverted);
|
||||
}
|
||||
|
||||
bool CameraPanInvertedY()
|
||||
{
|
||||
return GetRegistry(CameraPanInvertedYSetting, true);
|
||||
}
|
||||
|
||||
void SetCameraPanInvertedY(const bool inverted)
|
||||
{
|
||||
SetRegistry(CameraPanInvertedYSetting, inverted);
|
||||
}
|
||||
|
||||
float CameraPanSpeed()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(CameraPanSpeedSetting, 0.01));
|
||||
}
|
||||
|
||||
void SetCameraPanSpeed(float speed)
|
||||
{
|
||||
SetRegistry(CameraPanSpeedSetting, speed);
|
||||
}
|
||||
|
||||
float CameraRotateSmoothness()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(CameraRotateSmoothnessSetting, 5.0));
|
||||
}
|
||||
|
||||
void SetCameraRotateSmoothness(const float smoothness)
|
||||
{
|
||||
SetRegistry(CameraRotateSmoothnessSetting, smoothness);
|
||||
}
|
||||
|
||||
float CameraTranslateSmoothness()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(CameraTranslateSmoothnessSetting, 5.0));
|
||||
}
|
||||
|
||||
void SetCameraTranslateSmoothness(const float smoothness)
|
||||
{
|
||||
SetRegistry(CameraTranslateSmoothnessSetting, smoothness);
|
||||
}
|
||||
} // namespace SandboxEditor
|
||||
|
||||
@@ -17,25 +17,53 @@
|
||||
namespace SandboxEditor
|
||||
{
|
||||
SANDBOX_API bool GridSnappingEnabled();
|
||||
|
||||
SANDBOX_API float GridSnappingSize();
|
||||
|
||||
SANDBOX_API bool AngleSnappingEnabled();
|
||||
|
||||
SANDBOX_API float AngleSnappingSize();
|
||||
|
||||
SANDBOX_API bool ShowingGrid();
|
||||
|
||||
SANDBOX_API void SetGridSnapping(bool enabled);
|
||||
|
||||
SANDBOX_API float GridSnappingSize();
|
||||
SANDBOX_API void SetGridSnappingSize(float size);
|
||||
|
||||
SANDBOX_API bool AngleSnappingEnabled();
|
||||
SANDBOX_API void SetAngleSnapping(bool enabled);
|
||||
|
||||
SANDBOX_API float AngleSnappingSize();
|
||||
SANDBOX_API void SetAngleSnappingSize(float size);
|
||||
|
||||
SANDBOX_API bool ShowingGrid();
|
||||
SANDBOX_API void SetShowingGrid(bool showing);
|
||||
|
||||
SANDBOX_API float CameraTranslateSpeed();
|
||||
SANDBOX_API void SetCameraTranslateSpeed(float speed);
|
||||
|
||||
SANDBOX_API float CameraBoostMultiplier();
|
||||
SANDBOX_API void SetCameraBoostMultiplier(float multiplier);
|
||||
|
||||
SANDBOX_API float CameraRotateSpeed();
|
||||
SANDBOX_API void SetCameraRotateSpeed(float speed);
|
||||
|
||||
SANDBOX_API float CameraScrollSpeed();
|
||||
SANDBOX_API void SetCameraScrollSpeed(float speed);
|
||||
|
||||
SANDBOX_API float CameraDollyMotionSpeed();
|
||||
SANDBOX_API void SetCameraDollyMotionSpeed(float speed);
|
||||
|
||||
SANDBOX_API bool CameraOrbitYawRotationInverted();
|
||||
SANDBOX_API void SetCameraOrbitYawRotationInverted(bool inverted);
|
||||
|
||||
SANDBOX_API bool CameraPanInvertedX();
|
||||
SANDBOX_API void SetCameraPanInvertedX(bool inverted);
|
||||
|
||||
SANDBOX_API bool CameraPanInvertedY();
|
||||
SANDBOX_API void SetCameraPanInvertedY(bool inverted);
|
||||
|
||||
SANDBOX_API float CameraPanSpeed();
|
||||
SANDBOX_API void SetCameraPanSpeed(float speed);
|
||||
|
||||
SANDBOX_API float CameraRotateSmoothness();
|
||||
SANDBOX_API void SetCameraRotateSmoothness(float smoothness);
|
||||
|
||||
SANDBOX_API float CameraTranslateSmoothness();
|
||||
SANDBOX_API void SetCameraTranslateSmoothness(float smoothness);
|
||||
|
||||
//! Return if the new editor camera system is enabled or not.
|
||||
//! @note This is implemented in EditorViewportWidget.cpp
|
||||
SANDBOX_API bool UsingNewCameraSystem();
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
// Description : implementation filefov
|
||||
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "EditorViewportWidget.h"
|
||||
@@ -173,6 +172,7 @@ namespace AZ::ViewportHelpers
|
||||
{
|
||||
m_renderViewport.OnStopPlayInEditor();
|
||||
}
|
||||
|
||||
private:
|
||||
EditorViewportWidget& m_renderViewport;
|
||||
};
|
||||
@@ -402,7 +402,7 @@ void EditorViewportWidget::InjectFakeMouseMove(int deltaX, int deltaY, Qt::Mouse
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool EditorViewportWidget::event(QEvent* event)
|
||||
bool EditorViewportWidget::event(QEvent* event)
|
||||
{
|
||||
switch (event->type())
|
||||
{
|
||||
@@ -479,7 +479,6 @@ void EditorViewportWidget::Update()
|
||||
}
|
||||
m_updatingCameraPosition = false;
|
||||
|
||||
|
||||
// Don't wait for changes to update the focused viewport.
|
||||
if (CheckRespondToInput())
|
||||
{
|
||||
@@ -514,18 +513,28 @@ void EditorViewportWidget::Update()
|
||||
// Disable rendering to avoid recursion into Update()
|
||||
PushDisableRendering();
|
||||
|
||||
|
||||
//get debug display interface for the viewport
|
||||
AzFramework::DebugDisplayRequestBus::BusPtr debugDisplayBus;
|
||||
AzFramework::DebugDisplayRequestBus::Bind(debugDisplayBus, GetViewportId());
|
||||
AZ_Assert(debugDisplayBus, "Invalid DebugDisplayRequestBus.");
|
||||
|
||||
AzFramework::DebugDisplayRequests* debugDisplay =
|
||||
AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus);
|
||||
|
||||
|
||||
// draw debug visualizations
|
||||
if (m_debugDisplay)
|
||||
if (debugDisplay)
|
||||
{
|
||||
const AZ::u32 prevState = m_debugDisplay->GetState();
|
||||
m_debugDisplay->SetState(
|
||||
const AZ::u32 prevState = debugDisplay->GetState();
|
||||
debugDisplay->SetState(
|
||||
e_Mode3D | e_AlphaBlended | e_FillModeSolid | e_CullModeBack | e_DepthWriteOn | e_DepthTestOn);
|
||||
|
||||
AzFramework::EntityDebugDisplayEventBus::Broadcast(
|
||||
&AzFramework::EntityDebugDisplayEvents::DisplayEntityViewport,
|
||||
AzFramework::ViewportInfo{ GetViewportId() }, *m_debugDisplay);
|
||||
AzFramework::ViewportInfo{ GetViewportId() }, *debugDisplay);
|
||||
|
||||
m_debugDisplay->SetState(prevState);
|
||||
debugDisplay->SetState(prevState);
|
||||
}
|
||||
|
||||
QtViewport::Update();
|
||||
@@ -1205,6 +1214,166 @@ bool EditorViewportWidget::ShowingWorldSpace()
|
||||
return BuildKeyboardModifiers(QGuiApplication::queryKeyboardModifiers()).Shift();
|
||||
}
|
||||
|
||||
AZStd::shared_ptr<AtomToolsFramework::ModularViewportCameraController> CreateModularViewportCameraController(
|
||||
AzFramework::ViewportId viewportId)
|
||||
{
|
||||
AzFramework::ReloadCameraKeyBindings();
|
||||
|
||||
auto controller = AZStd::make_shared<AtomToolsFramework::ModularViewportCameraController>();
|
||||
controller->SetCameraPropsBuilderCallback(
|
||||
[](AzFramework::CameraProps& cameraProps)
|
||||
{
|
||||
cameraProps.m_rotateSmoothnessFn = []
|
||||
{
|
||||
return SandboxEditor::CameraRotateSmoothness();
|
||||
};
|
||||
|
||||
cameraProps.m_translateSmoothnessFn = []
|
||||
{
|
||||
return SandboxEditor::CameraTranslateSmoothness();
|
||||
};
|
||||
});
|
||||
|
||||
controller->SetCameraListBuilderCallback(
|
||||
[viewportId](AzFramework::Cameras& cameras)
|
||||
{
|
||||
auto firstPersonRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraFreeLookButton);
|
||||
firstPersonRotateCamera->m_rotateSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraRotateSpeed();
|
||||
};
|
||||
|
||||
auto firstPersonPanCamera =
|
||||
AZStd::make_shared<AzFramework::PanCameraInput>(AzFramework::CameraFreePanButton, AzFramework::LookPan);
|
||||
firstPersonPanCamera->m_panSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanSpeed();
|
||||
};
|
||||
firstPersonPanCamera->m_invertPanXFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanInvertedX();
|
||||
};
|
||||
firstPersonPanCamera->m_invertPanYFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanInvertedY();
|
||||
};
|
||||
|
||||
auto firstPersonTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::LookTranslation);
|
||||
firstPersonTranslateCamera->m_translateSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraTranslateSpeed();
|
||||
};
|
||||
firstPersonTranslateCamera->m_boostMultiplierFn = []
|
||||
{
|
||||
return SandboxEditor::CameraBoostMultiplier();
|
||||
};
|
||||
|
||||
auto firstPersonWheelCamera = AZStd::make_shared<AzFramework::ScrollTranslationCameraInput>();
|
||||
firstPersonWheelCamera->m_scrollSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraScrollSpeed();
|
||||
};
|
||||
|
||||
auto orbitCamera = AZStd::make_shared<AzFramework::OrbitCameraInput>();
|
||||
orbitCamera->SetLookAtFn(
|
||||
[viewportId](const AZ::Vector3& position, const AZ::Vector3& direction) -> AZStd::optional<AZ::Vector3>
|
||||
{
|
||||
AZStd::optional<AZ::Vector3> lookAtAfterInterpolation;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
lookAtAfterInterpolation, viewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::LookAtAfterInterpolation);
|
||||
|
||||
// initially attempt to use the last set look at point after an interpolation has finished
|
||||
if (lookAtAfterInterpolation.has_value())
|
||||
{
|
||||
return *lookAtAfterInterpolation;
|
||||
}
|
||||
|
||||
const float RayDistance = 1000.0f;
|
||||
AzFramework::RenderGeometry::RayRequest ray;
|
||||
ray.m_startWorldPosition = position;
|
||||
ray.m_endWorldPosition = position + direction * RayDistance;
|
||||
ray.m_onlyVisible = true;
|
||||
|
||||
AzFramework::RenderGeometry::RayResult renderGeometryIntersectionResult;
|
||||
AzFramework::RenderGeometry::IntersectorBus::EventResult(
|
||||
renderGeometryIntersectionResult, AzToolsFramework::GetEntityContextId(),
|
||||
&AzFramework::RenderGeometry::IntersectorBus::Events::RayIntersect, ray);
|
||||
|
||||
// attempt a ray intersection with any visible mesh and return the intersection position if successful
|
||||
if (renderGeometryIntersectionResult)
|
||||
{
|
||||
return renderGeometryIntersectionResult.m_worldPosition;
|
||||
}
|
||||
|
||||
// if there is no selection or no intersection, fallback to default camera orbit behavior (ground plane
|
||||
// intersection)
|
||||
return {};
|
||||
});
|
||||
|
||||
auto orbitRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraOrbitLookButton);
|
||||
orbitRotateCamera->m_rotateSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraRotateSpeed();
|
||||
};
|
||||
orbitRotateCamera->m_invertYawFn = []
|
||||
{
|
||||
return SandboxEditor::CameraOrbitYawRotationInverted();
|
||||
};
|
||||
|
||||
auto orbitTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::OrbitTranslation);
|
||||
orbitTranslateCamera->m_translateSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraTranslateSpeed();
|
||||
};
|
||||
orbitTranslateCamera->m_boostMultiplierFn = []
|
||||
{
|
||||
return SandboxEditor::CameraBoostMultiplier();
|
||||
};
|
||||
|
||||
auto orbitDollyWheelCamera = AZStd::make_shared<AzFramework::OrbitDollyScrollCameraInput>();
|
||||
orbitDollyWheelCamera->m_scrollSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraScrollSpeed();
|
||||
};
|
||||
|
||||
auto orbitDollyMoveCamera =
|
||||
AZStd::make_shared<AzFramework::OrbitDollyCursorMoveCameraInput>(AzFramework::CameraOrbitDollyButton);
|
||||
orbitDollyMoveCamera->m_cursorSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraDollyMotionSpeed();
|
||||
};
|
||||
|
||||
auto orbitPanCamera = AZStd::make_shared<AzFramework::PanCameraInput>(AzFramework::CameraOrbitPanButton, AzFramework::OrbitPan);
|
||||
orbitPanCamera->m_panSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanSpeed();
|
||||
};
|
||||
orbitPanCamera->m_invertPanXFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanInvertedX();
|
||||
};
|
||||
orbitPanCamera->m_invertPanYFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanInvertedY();
|
||||
};
|
||||
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitRotateCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitTranslateCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitDollyWheelCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitDollyMoveCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitPanCamera);
|
||||
|
||||
cameras.AddCamera(firstPersonRotateCamera);
|
||||
cameras.AddCamera(firstPersonPanCamera);
|
||||
cameras.AddCamera(firstPersonTranslateCamera);
|
||||
cameras.AddCamera(firstPersonWheelCamera);
|
||||
cameras.AddCamera(orbitCamera);
|
||||
});
|
||||
|
||||
return controller;
|
||||
}
|
||||
|
||||
void EditorViewportWidget::SetViewportId(int id)
|
||||
{
|
||||
CViewport::SetViewportId(id);
|
||||
@@ -1229,77 +1398,7 @@ void EditorViewportWidget::SetViewportId(int id)
|
||||
|
||||
if (ed_useNewCameraSystem)
|
||||
{
|
||||
AzFramework::ReloadCameraKeyBindings();
|
||||
|
||||
auto controller = AZStd::make_shared<AtomToolsFramework::ModularViewportCameraController>();
|
||||
controller->SetCameraListBuilderCallback(
|
||||
[id](AzFramework::Cameras& cameras)
|
||||
{
|
||||
auto firstPersonRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraFreeLookButton);
|
||||
auto firstPersonPanCamera =
|
||||
AZStd::make_shared<AzFramework::PanCameraInput>(AzFramework::CameraFreePanButton, AzFramework::LookPan);
|
||||
auto firstPersonTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::LookTranslation);
|
||||
auto firstPersonWheelCamera = AZStd::make_shared<AzFramework::ScrollTranslationCameraInput>();
|
||||
|
||||
auto orbitCamera = AZStd::make_shared<AzFramework::OrbitCameraInput>();
|
||||
orbitCamera->SetLookAtFn(
|
||||
[id](const AZ::Vector3& position, const AZ::Vector3& direction) -> AZStd::optional<AZ::Vector3>
|
||||
{
|
||||
AZStd::optional<AZ::Vector3> lookAtAfterInterpolation;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
lookAtAfterInterpolation, id,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::LookAtAfterInterpolation);
|
||||
|
||||
// initially attempt to use the last set look at point after an interpolation has finished
|
||||
if (lookAtAfterInterpolation.has_value())
|
||||
{
|
||||
return *lookAtAfterInterpolation;
|
||||
}
|
||||
|
||||
const float RayDistance = 1000.0f;
|
||||
AzFramework::RenderGeometry::RayRequest ray;
|
||||
ray.m_startWorldPosition = position;
|
||||
ray.m_endWorldPosition = position + direction * RayDistance;
|
||||
ray.m_onlyVisible = true;
|
||||
|
||||
AzFramework::RenderGeometry::RayResult renderGeometryIntersectionResult;
|
||||
AzFramework::RenderGeometry::IntersectorBus::EventResult(
|
||||
renderGeometryIntersectionResult, AzToolsFramework::GetEntityContextId(),
|
||||
&AzFramework::RenderGeometry::IntersectorInterface::RayIntersect, ray);
|
||||
|
||||
// attempt a ray intersection with any visible mesh and return the intersection position if successful
|
||||
if (renderGeometryIntersectionResult)
|
||||
{
|
||||
return renderGeometryIntersectionResult.m_worldPosition;
|
||||
}
|
||||
|
||||
// if there is no selection or no intersection, fallback to default camera orbit behavior (ground plane
|
||||
// intersection)
|
||||
return {};
|
||||
});
|
||||
|
||||
auto orbitRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraOrbitLookButton);
|
||||
auto orbitTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::OrbitTranslation);
|
||||
auto orbitDollyWheelCamera = AZStd::make_shared<AzFramework::OrbitDollyScrollCameraInput>();
|
||||
auto orbitDollyMoveCamera =
|
||||
AZStd::make_shared<AzFramework::OrbitDollyCursorMoveCameraInput>(AzFramework::CameraOrbitDollyButton);
|
||||
auto orbitPanCamera =
|
||||
AZStd::make_shared<AzFramework::PanCameraInput>(AzFramework::CameraOrbitPanButton, AzFramework::OrbitPan);
|
||||
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitRotateCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitTranslateCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitDollyWheelCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitDollyMoveCamera);
|
||||
orbitCamera->m_orbitCameras.AddCamera(orbitPanCamera);
|
||||
|
||||
cameras.AddCamera(firstPersonRotateCamera);
|
||||
cameras.AddCamera(firstPersonPanCamera);
|
||||
cameras.AddCamera(firstPersonTranslateCamera);
|
||||
cameras.AddCamera(firstPersonWheelCamera);
|
||||
cameras.AddCamera(orbitCamera);
|
||||
});
|
||||
|
||||
m_renderViewport->GetControllerList()->Add(controller);
|
||||
m_renderViewport->GetControllerList()->Add(CreateModularViewportCameraController(AzFramework::ViewportId(id)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1367,7 +1466,7 @@ namespace AZ::ViewportHelpers
|
||||
action->setCheckable(true);
|
||||
action->setChecked(*variable);
|
||||
}
|
||||
}
|
||||
} // namespace AZ::ViewportHelpers
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void EditorViewportWidget::OnTitleMenu(QMenu* menu)
|
||||
@@ -1615,7 +1714,6 @@ void EditorViewportWidget::ToggleCameraObject()
|
||||
GetIEditor()->GetAnimation()->ForceAnimation();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void EditorViewportWidget::SetCamera(const CCamera& camera)
|
||||
{
|
||||
@@ -1623,30 +1721,6 @@ void EditorViewportWidget::SetCamera(const CCamera& camera)
|
||||
SetViewTM(m_Camera.GetMatrix());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
float EditorViewportWidget::GetCameraMoveSpeed() const
|
||||
{
|
||||
return gSettings.cameraMoveSpeed;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
float EditorViewportWidget::GetCameraRotateSpeed() const
|
||||
{
|
||||
return gSettings.cameraRotateSpeed;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool EditorViewportWidget::GetCameraInvertYRotation() const
|
||||
{
|
||||
return gSettings.invertYRotation;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
float EditorViewportWidget::GetCameraInvertPan() const
|
||||
{
|
||||
return gSettings.invertPan;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
EditorViewportWidget* EditorViewportWidget::GetPrimaryViewport()
|
||||
{
|
||||
@@ -1946,7 +2020,6 @@ void EditorViewportWidget::RenderSelectedRegion()
|
||||
Vec3(x1, y2, fMinZ)
|
||||
};
|
||||
|
||||
|
||||
// Generate vertices
|
||||
static AABB boxPrev(AABB::RESET);
|
||||
static std::vector<Vec3> verts;
|
||||
@@ -2508,14 +2581,14 @@ void EditorViewportWidget::SetSequenceCamera()
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void EditorViewportWidget::SetComponentCamera(const AZ::EntityId& entityId)
|
||||
void EditorViewportWidget::SetComponentCamera(const AZ::EntityId& entityId)
|
||||
{
|
||||
ResetToViewSourceType(ViewSourceType::CameraComponent);
|
||||
SetViewEntity(entityId);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void EditorViewportWidget::SetEntityAsCamera(const AZ::EntityId& entityId, bool lockCameraMovement)
|
||||
void EditorViewportWidget::SetEntityAsCamera(const AZ::EntityId& entityId, bool lockCameraMovement)
|
||||
{
|
||||
ResetToViewSourceType(ViewSourceType::AZ_Entity);
|
||||
SetViewEntity(entityId, lockCameraMovement);
|
||||
@@ -2664,6 +2737,18 @@ bool EditorViewportWidget::GetActiveCameraPosition(AZ::Vector3& cameraPos)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EditorViewportWidget::GetActiveCameraState(AzFramework::CameraState& cameraState)
|
||||
{
|
||||
if (m_pPrimaryViewport == this)
|
||||
{
|
||||
cameraState = GetCameraState();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void EditorViewportWidget::OnStartPlayInEditor()
|
||||
{
|
||||
if (m_viewEntityId.IsValid())
|
||||
@@ -2752,18 +2837,18 @@ bool EditorViewportWidget::IsRenderingDisabled() const
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
QPoint EditorViewportWidget::WidgetToViewport(const QPoint &point) const
|
||||
QPoint EditorViewportWidget::WidgetToViewport(const QPoint& point) const
|
||||
{
|
||||
return point * WidgetToViewportFactor();
|
||||
}
|
||||
|
||||
QPoint EditorViewportWidget::ViewportToWidget(const QPoint &point) const
|
||||
QPoint EditorViewportWidget::ViewportToWidget(const QPoint& point) const
|
||||
{
|
||||
return point / WidgetToViewportFactor();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
QSize EditorViewportWidget::WidgetToViewport(const QSize &size) const
|
||||
QSize EditorViewportWidget::WidgetToViewport(const QSize& size) const
|
||||
{
|
||||
return size * WidgetToViewportFactor();
|
||||
}
|
||||
|
||||
@@ -184,6 +184,7 @@ public:
|
||||
void SetViewAndMovementLockFromEntityPerspective(const AZ::EntityId& entityId, bool lockCameraMovement) override;
|
||||
AZ::EntityId GetCurrentViewEntityId() override { return m_viewEntityId; }
|
||||
bool GetActiveCameraPosition(AZ::Vector3& cameraPos) override;
|
||||
bool GetActiveCameraState(AzFramework::CameraState& cameraState) override;
|
||||
|
||||
// AzToolsFramework::EditorEntityContextNotificationBus (handler moved to cpp to resolve link issues in unity builds)
|
||||
virtual void OnStartPlayInEditor();
|
||||
@@ -327,11 +328,6 @@ protected:
|
||||
|
||||
void SetViewTM(const Matrix34& tm, bool bMoveOnly);
|
||||
|
||||
virtual float GetCameraMoveSpeed() const;
|
||||
virtual float GetCameraRotateSpeed() const;
|
||||
virtual bool GetCameraInvertYRotation() const;
|
||||
virtual float GetCameraInvertPan() const;
|
||||
|
||||
// Called to render stuff.
|
||||
virtual void OnRender();
|
||||
|
||||
|
||||
@@ -267,14 +267,12 @@ AZ_POP_DISABLE_WARNING
|
||||
m_levelExtension = EditorUtils::LevelFile::GetDefaultFileExtension();
|
||||
m_playerViewTM.SetIdentity();
|
||||
GetIEditor()->RegisterNotifyListener(this);
|
||||
AZ::Interface<IEditorCameraController>::Register(this);
|
||||
}
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4273, "-Wunknown-warning-option")
|
||||
CGameEngine::~CGameEngine()
|
||||
{
|
||||
AZ_POP_DISABLE_WARNING
|
||||
AZ::Interface<IEditorCameraController>::Unregister(this);
|
||||
GetIEditor()->UnregisterNotifyListener(this);
|
||||
m_pISystem->GetIMovieSystem()->SetCallback(NULL);
|
||||
|
||||
@@ -349,38 +347,6 @@ static void CmdGotoEditor(IConsoleCmdArgs* pArgs)
|
||||
}
|
||||
}
|
||||
|
||||
void CGameEngine::SetCurrentViewPosition(const AZ::Vector3& position)
|
||||
{
|
||||
CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport();
|
||||
if (pRenderViewport)
|
||||
{
|
||||
CUndo undo("Set Current View Position");
|
||||
if (CUndo::IsRecording())
|
||||
{
|
||||
CUndo::Record(new CUndoViewPosition());
|
||||
}
|
||||
Matrix34 tm = pRenderViewport->GetViewTM();
|
||||
tm.SetTranslation(Vec3(position.GetX(), position.GetY(), position.GetZ()));
|
||||
pRenderViewport->SetViewTM(tm);
|
||||
}
|
||||
}
|
||||
|
||||
void CGameEngine::SetCurrentViewRotation(const AZ::Vector3& rotation)
|
||||
{
|
||||
CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport();
|
||||
if (pRenderViewport)
|
||||
{
|
||||
CUndo undo("Set Current View Rotation");
|
||||
if (CUndo::IsRecording())
|
||||
{
|
||||
CUndo::Record(new CUndoViewRotation());
|
||||
}
|
||||
Matrix34 tm = pRenderViewport->GetViewTM();
|
||||
tm.SetRotationXYZ(Ang3(DEG2RAD(rotation.GetX()), DEG2RAD(rotation.GetY()), DEG2RAD(rotation.GetZ())), tm.GetTranslation());
|
||||
pRenderViewport->SetViewTM(tm);
|
||||
}
|
||||
}
|
||||
|
||||
AZ::Outcome<void, AZStd::string> CGameEngine::Init(
|
||||
bool bPreviewMode,
|
||||
bool bTestMode,
|
||||
@@ -627,6 +593,8 @@ void CGameEngine::SwitchToInGame()
|
||||
&AzFramework::InputSystemCursorRequests::SetSystemCursorState,
|
||||
AzFramework::SystemCursorState::ConstrainedAndHidden);
|
||||
}
|
||||
|
||||
Log("Entered game mode");
|
||||
}
|
||||
|
||||
void CGameEngine::SwitchToInEditor()
|
||||
@@ -681,6 +649,8 @@ void CGameEngine::SwitchToInEditor()
|
||||
AzFramework::InputSystemCursorRequestBus::Event(AzFramework::InputDeviceMouse::Id,
|
||||
&AzFramework::InputSystemCursorRequests::SetSystemCursorState,
|
||||
AzFramework::SystemCursorState::UnconstrainedAndVisible);
|
||||
|
||||
Log("Exited game mode");
|
||||
}
|
||||
|
||||
void CGameEngine::HandleQuitRequest(IConsoleCmdArgs* /*args*/)
|
||||
|
||||
@@ -32,24 +32,6 @@ struct IInitializeUIInfo;
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
{
|
||||
//! Operates the Editor's camera
|
||||
class IEditorCameraController
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(IEditorCameraController, "{AEF60D3E-10A1-4161-9379-F68C69A5959C}");
|
||||
|
||||
IEditorCameraController() = default;
|
||||
IEditorCameraController(IEditorCameraController&&) = delete;
|
||||
IEditorCameraController& operator=(IEditorCameraController&&) = delete;
|
||||
virtual ~IEditorCameraController() = default;
|
||||
|
||||
virtual void SetCurrentViewPosition([[maybe_unused]] const AZ::Vector3& position) {}
|
||||
virtual void SetCurrentViewRotation([[maybe_unused]] const AZ::Vector3& rotation) {}
|
||||
};
|
||||
}
|
||||
|
||||
class ThreadedOnErrorHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -68,7 +50,6 @@ AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
//! This class serves as a high-level wrapper for CryEngine game.
|
||||
class SANDBOX_API CGameEngine
|
||||
: public IEditorNotifyListener
|
||||
, private AzToolsFramework::IEditorCameraController
|
||||
{
|
||||
AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
public:
|
||||
@@ -153,11 +134,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
AZ_PUSH_DISABLE_WARNING(4273, "-Wunknown-warning-option")
|
||||
void SetCurrentViewPosition(const AZ::Vector3& position) override;
|
||||
void SetCurrentViewRotation(const AZ::Vector3& rotation) override;
|
||||
AZ_POP_DISABLE_OVERRIDE_WARNING
|
||||
|
||||
void SetGameMode(bool inGame);
|
||||
void SwitchToInGame();
|
||||
void SwitchToInEditor();
|
||||
|
||||
@@ -1,174 +1,122 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "GotoPositionDlg.h"
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "GotoPositionDlg.h"
|
||||
|
||||
// Editor
|
||||
#include "ViewManager.h"
|
||||
#include "EditorViewportCamera.h"
|
||||
#include "GameEngine.h"
|
||||
#include "ViewManager.h"
|
||||
|
||||
#include <AzFramework/Viewport/CameraInput.h>
|
||||
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include <ui_GotoPositionDlg.h>
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGotoPositionDlg dialog
|
||||
|
||||
|
||||
CGotoPositionDlg::CGotoPositionDlg(QWidget* pParent /*=NULL*/)
|
||||
: QDialog(pParent)
|
||||
, m_ui(new Ui::GotoPositionDlg)
|
||||
GotoPositionDialog::GotoPositionDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::GotoPositionDialog)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setFixedSize(size());
|
||||
OnInitDialog();
|
||||
|
||||
auto doubleValueChanged = static_cast<void(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged);
|
||||
auto valueChanged = static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged);
|
||||
auto doubleValueChanged = static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged);
|
||||
|
||||
connect(m_ui->m_posEdit, &QLineEdit::editingFinished, this, &CGotoPositionDlg::OnChangeEdit);
|
||||
connect(m_ui->m_dymX, doubleValueChanged, this, &CGotoPositionDlg::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymY, doubleValueChanged, this, &CGotoPositionDlg::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymZ, doubleValueChanged, this, &CGotoPositionDlg::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymAngleX, doubleValueChanged, this, &CGotoPositionDlg::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymAngleY, doubleValueChanged, this, &CGotoPositionDlg::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymAngleZ, doubleValueChanged, this, &CGotoPositionDlg::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymSegX, valueChanged, this, &CGotoPositionDlg::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymSegY, valueChanged, this, &CGotoPositionDlg::OnUpdateNumbers);
|
||||
connect(m_ui->m_posEdit, &QLineEdit::editingFinished, this, &GotoPositionDialog::OnChangeEdit);
|
||||
connect(m_ui->m_dymX, doubleValueChanged, this, &GotoPositionDialog::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymY, doubleValueChanged, this, &GotoPositionDialog::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymZ, doubleValueChanged, this, &GotoPositionDialog::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymAnglePitch, doubleValueChanged, this, &GotoPositionDialog::OnUpdateNumbers);
|
||||
connect(m_ui->m_dymAngleYaw, doubleValueChanged, this, &GotoPositionDialog::OnUpdateNumbers);
|
||||
}
|
||||
|
||||
CGotoPositionDlg::~CGotoPositionDlg()
|
||||
GotoPositionDialog::~GotoPositionDialog() = default;
|
||||
|
||||
void GotoPositionDialog::OnInitDialog()
|
||||
{
|
||||
}
|
||||
const auto cameraTransform = SandboxEditor::GetDefaultViewportCameraTransform();
|
||||
const auto cameraTranslation = cameraTransform.GetTranslation();
|
||||
const auto cameraRotation = AzFramework::EulerAngles(AZ::Matrix3x3::CreateFromQuaternion(cameraTransform.GetRotation()));
|
||||
const auto pitchDegrees = AZ::RadToDeg(cameraRotation.GetX());
|
||||
const auto yawDegrees = AZ::RadToDeg(cameraRotation.GetZ());
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGotoPositionDlg message handlers
|
||||
// position
|
||||
m_ui->m_dymX->setRange(-64000.0, 64000.0);
|
||||
m_ui->m_dymX->setValue(cameraTranslation.GetX());
|
||||
|
||||
m_ui->m_dymY->setRange(-64000.0, 64000.0);
|
||||
m_ui->m_dymY->setValue(cameraTranslation.GetY());
|
||||
|
||||
void CGotoPositionDlg::OnInitDialog()
|
||||
{
|
||||
Vec3 pos;
|
||||
Ang3 angle;
|
||||
m_ui->m_dymZ->setRange(-64000.0, 64000.0);
|
||||
m_ui->m_dymZ->setValue(cameraTranslation.GetZ());
|
||||
|
||||
CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport();
|
||||
if (pRenderViewport)
|
||||
{
|
||||
Matrix34 tm = pRenderViewport->GetViewTM();
|
||||
pos = pRenderViewport->GetViewTM().GetTranslation();
|
||||
angle = RAD2DEG(Ang3::GetAnglesXYZ(tm));
|
||||
}
|
||||
// rotation
|
||||
m_ui->m_dymAnglePitch->setRange(-180.0, 180.0);
|
||||
m_ui->m_dymAnglePitch->setValue(pitchDegrees);
|
||||
|
||||
// CORDS --------------------------------------
|
||||
m_ui->m_dymX->setRange(-64000, 64000);
|
||||
m_ui->m_dymX->setValue(pos.x);
|
||||
m_ui->m_dymAngleYaw->setRange(-180.0, 180.0);
|
||||
m_ui->m_dymAngleYaw->setValue(yawDegrees);
|
||||
|
||||
m_ui->m_dymY->setRange(-64000, 64000);
|
||||
m_ui->m_dymY->setValue(pos.y);
|
||||
|
||||
m_ui->m_dymZ->setRange(-64000, 64000);
|
||||
m_ui->m_dymZ->setValue(pos.z);
|
||||
|
||||
// ANGLES -------------------------------------
|
||||
m_ui->m_dymAngleX->setRange(-180, 180);
|
||||
m_ui->m_dymAngleX->setValue(angle.x);
|
||||
|
||||
m_ui->m_dymAngleY->setRange(-180, 180);
|
||||
m_ui->m_dymAngleY->setValue(angle.y);
|
||||
|
||||
m_ui->m_dymAngleZ->setRange(-180, 180);
|
||||
m_ui->m_dymAngleZ->setValue(angle.z);
|
||||
|
||||
|
||||
m_ui->m_labelSeg->setVisible(false);
|
||||
m_ui->m_labelSegX->setVisible(false);
|
||||
m_ui->m_labelSegY->setVisible(false);
|
||||
m_ui->m_dymSegX->setVisible(false);
|
||||
m_ui->m_dymSegY->setVisible(false);
|
||||
|
||||
// Ensure the goto button is highlighted correctly.
|
||||
// ensure the goto button is highlighted correctly.
|
||||
m_ui->pushButton->setDefault(true);
|
||||
|
||||
OnUpdateNumbers();
|
||||
}
|
||||
|
||||
|
||||
void CGotoPositionDlg::OnChangeEdit()
|
||||
void GotoPositionDialog::OnChangeEdit()
|
||||
{
|
||||
const int lengthInSw = 8;
|
||||
const int strNum = 6;
|
||||
AZStd::vector<float> pos(strNum);
|
||||
const int argCount = 5;
|
||||
AZStd::vector<float> transform(argCount);
|
||||
|
||||
m_sPos = m_ui->m_posEdit->text();
|
||||
const QStringList parts = m_sPos.split(QRegularExpression("[\\s,;\\t]"), Qt::SkipEmptyParts);
|
||||
for (int k = 0; k < strNum && k < parts.count(); ++k)
|
||||
m_transform = m_ui->m_posEdit->text();
|
||||
const QStringList parts = m_transform.split(QRegularExpression("[\\s,;\\t]"), Qt::SkipEmptyParts);
|
||||
for (int i = 0; i < argCount && i < parts.count(); ++i)
|
||||
{
|
||||
pos[k] = parts[k].toDouble();
|
||||
transform[i] = parts[i].toDouble();
|
||||
}
|
||||
|
||||
m_ui->m_dymX->setValue(pos[0]);
|
||||
m_ui->m_dymY->setValue(pos[1]);
|
||||
m_ui->m_dymZ->setValue(pos[2]);
|
||||
m_ui->m_dymAngleX->setValue(pos[3]);
|
||||
m_ui->m_dymAngleY->setValue(pos[4]);
|
||||
m_ui->m_dymAngleZ->setValue(pos[5]);
|
||||
|
||||
if constexpr (strNum == lengthInSw)
|
||||
{
|
||||
if (parts.count() == lengthInSw)
|
||||
{
|
||||
m_ui->m_dymSegX->setValue(static_cast<int>(parts[6].toDouble()));
|
||||
m_ui->m_dymSegY->setValue(static_cast<int>(parts[7].toDouble()));
|
||||
}
|
||||
}
|
||||
m_ui->m_dymX->setValue(transform[0]);
|
||||
m_ui->m_dymY->setValue(transform[1]);
|
||||
m_ui->m_dymZ->setValue(transform[2]);
|
||||
m_ui->m_dymAnglePitch->setValue(transform[3]);
|
||||
m_ui->m_dymAngleYaw->setValue(transform[4]);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CGotoPositionDlg::OnUpdateNumbers()
|
||||
void GotoPositionDialog::OnUpdateNumbers()
|
||||
{
|
||||
m_ui->m_posEdit->setText(QString::fromLatin1("%1, %2, %3, %4, %5, %6")
|
||||
.arg(m_ui->m_dymX->value(), 2, 'f', 2).arg(m_ui->m_dymY->value(), 2, 'f', 2).arg(m_ui->m_dymZ->value(), 2, 'f', 2)
|
||||
.arg(m_ui->m_dymAngleX->value(), 2, 'f', 2).arg(m_ui->m_dymAngleY->value(), 2, 'f', 2).arg(m_ui->m_dymAngleZ->value(), 2, 'f', 2));
|
||||
m_ui->m_posEdit->setText(QString::fromLatin1("%1, %2, %3, %4, %5")
|
||||
.arg(m_ui->m_dymX->value(), 2, 'f', 2)
|
||||
.arg(m_ui->m_dymY->value(), 2, 'f', 2)
|
||||
.arg(m_ui->m_dymZ->value(), 2, 'f', 2)
|
||||
.arg(m_ui->m_dymAnglePitch->value(), 2, 'f', 2)
|
||||
.arg(m_ui->m_dymAngleYaw->value(), 2, 'f', 2));
|
||||
}
|
||||
|
||||
|
||||
void CGotoPositionDlg::accept()
|
||||
void GotoPositionDialog::accept()
|
||||
{
|
||||
Vec3 vPos(m_ui->m_dymX->value(), m_ui->m_dymY->value(), m_ui->m_dymZ->value());
|
||||
|
||||
m_ui->m_dymX->setValue(vPos.x);
|
||||
m_ui->m_dymY->setValue(vPos.y);
|
||||
m_ui->m_dymZ->setValue(vPos.z);
|
||||
|
||||
AzToolsFramework::IEditorCameraController* editorCameraController = AZ::Interface<AzToolsFramework::IEditorCameraController>::Get();
|
||||
AZ_Error("editor", editorCameraController, "IEditorCameraCommands is not registered.");
|
||||
if (editorCameraController)
|
||||
{
|
||||
editorCameraController->SetCurrentViewPosition(AZ::Vector3{
|
||||
aznumeric_cast<float>(m_ui->m_dymX->value()),
|
||||
aznumeric_cast<float>(m_ui->m_dymY->value()),
|
||||
aznumeric_cast<float>(m_ui->m_dymZ->value())
|
||||
});
|
||||
editorCameraController->SetCurrentViewRotation(AZ::Vector3{
|
||||
aznumeric_cast<float>(m_ui->m_dymAngleX->value()),
|
||||
aznumeric_cast<float>(m_ui->m_dymAngleY->value()),
|
||||
aznumeric_cast<float>(m_ui->m_dymAngleZ->value())
|
||||
});
|
||||
}
|
||||
SandboxEditor::SetDefaultViewportCameraPosition(AZ::Vector3(
|
||||
aznumeric_cast<float>(m_ui->m_dymX->value()), aznumeric_cast<float>(m_ui->m_dymY->value()),
|
||||
aznumeric_cast<float>(m_ui->m_dymZ->value())));
|
||||
SandboxEditor::SetDefaultViewportCameraRotation(
|
||||
AZ::DegToRad(aznumeric_cast<float>(m_ui->m_dymAnglePitch->value())),
|
||||
AZ::DegToRad(aznumeric_cast<float>(m_ui->m_dymAngleYaw->value())));
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
@@ -11,12 +11,7 @@
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_GOTOPOSITIONDLG_H
|
||||
#define CRYINCLUDE_EDITOR_GOTOPOSITIONDLG_H
|
||||
|
||||
#pragma once
|
||||
// GotoPositionDlg.h : header file
|
||||
//
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QDialog>
|
||||
@@ -24,22 +19,19 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class GotoPositionDlg;
|
||||
class GotoPositionDialog;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CGotoPositionDlg dialog
|
||||
|
||||
class CGotoPositionDlg
|
||||
//! GotoPositionDialog for setting camera position and rotation.
|
||||
class GotoPositionDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
// Construction
|
||||
public:
|
||||
CGotoPositionDlg(QWidget* pParent = nullptr); // standard constructor
|
||||
~CGotoPositionDlg();
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
explicit GotoPositionDialog(QWidget* parent = nullptr);
|
||||
~GotoPositionDialog();
|
||||
|
||||
protected:
|
||||
void OnInitDialog();
|
||||
void accept() override;
|
||||
@@ -47,12 +39,9 @@ protected:
|
||||
void OnUpdateNumbers();
|
||||
void OnChangeEdit();
|
||||
|
||||
|
||||
public:
|
||||
QString m_sPos;
|
||||
QString m_transform;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::GotoPositionDlg> m_ui;
|
||||
QScopedPointer<Ui::GotoPositionDialog> m_ui;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_GOTOPOSITIONDLG_H
|
||||
|
||||
@@ -1,226 +1,166 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GotoPositionDlg</class>
|
||||
<widget class="QDialog" name="GotoPositionDlg">
|
||||
<class>GotoPositionDialog</class>
|
||||
<widget class="QDialog" name="GotoPositionDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>290</width>
|
||||
<height>180</height>
|
||||
<width>182</width>
|
||||
<height>174</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Go to Position</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0,0,0,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="3" colspan="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Angles:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymZ"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymX"/>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="7">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Enter position here:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Position:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Z:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Pitch:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Yaw:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleYaw"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymY"/>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="7">
|
||||
<widget class="QLineEdit" name="m_posEdit">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAnglePitch"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="buttonLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0,0,1,0,0,1">
|
||||
<item row="5" column="6" colspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymZ"/>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymY"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_dymX"/>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleY"/>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleX"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Z:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="8">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Enter position here:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="8">
|
||||
<widget class="QLineEdit" name="m_posEdit">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Position:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="6">
|
||||
<widget class="QLabel" name="m_labelSegX">
|
||||
<property name="text">
|
||||
<string>X:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="QDoubleSpinBox" name="m_dymAngleZ"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="6">
|
||||
<widget class="QLabel" name="m_labelSegY">
|
||||
<property name="text">
|
||||
<string>Y:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Z:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="3" colspan="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Angles:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6" colspan="2">
|
||||
<widget class="QLabel" name="m_labelSeg">
|
||||
<property name="text">
|
||||
<string>Segments:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="7">
|
||||
<widget class="QSpinBox" name="m_dymSegX"/>
|
||||
</item>
|
||||
<item row="4" column="7">
|
||||
<widget class="QSpinBox" name="m_dymSegY"/>
|
||||
</item>
|
||||
</layout>
|
||||
<spacer name="horizontalSpacer_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="buttonLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Go To</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Go To</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>m_posEdit</tabstop>
|
||||
<tabstop>m_dymX</tabstop>
|
||||
<tabstop>m_dymY</tabstop>
|
||||
<tabstop>m_dymZ</tabstop>
|
||||
<tabstop>m_dymAngleX</tabstop>
|
||||
<tabstop>m_dymAngleY</tabstop>
|
||||
<tabstop>m_dymAngleZ</tabstop>
|
||||
<tabstop>m_dymSegX</tabstop>
|
||||
<tabstop>m_dymSegY</tabstop>
|
||||
<tabstop>m_dymAnglePitch</tabstop>
|
||||
<tabstop>m_dymAngleYaw</tabstop>
|
||||
<tabstop>pushButton_2</tabstop>
|
||||
<tabstop>pushButton</tabstop>
|
||||
</tabstops>
|
||||
@@ -229,7 +169,7 @@
|
||||
<connection>
|
||||
<sender>pushButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>GotoPositionDlg</receiver>
|
||||
<receiver>GotoPositionDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
@@ -245,7 +185,7 @@
|
||||
<connection>
|
||||
<sender>pushButton_2</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>GotoPositionDlg</receiver>
|
||||
<receiver>GotoPositionDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
|
||||
@@ -833,13 +833,6 @@ void MainWindow::InitActions()
|
||||
.Connect(&QAction::triggered, []() { SandboxEditor::SetAngleSnapping(!SandboxEditor::AngleSnappingEnabled()); });
|
||||
|
||||
// Display actions
|
||||
am->AddAction(ID_WIREFRAME, tr("&Wireframe"))
|
||||
.SetShortcut(tr("F3"))
|
||||
.SetToolTip(tr("Wireframe (F3)"))
|
||||
.SetCheckable(true)
|
||||
.SetStatusTip(tr("Render in Wireframe Mode."))
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateWireframe);
|
||||
|
||||
am->AddAction(ID_SWITCHCAMERA_DEFAULTCAMERA, tr("Default Camera")).SetCheckable(true)
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateSwitchToDefaultCamera);
|
||||
am->AddAction(ID_SWITCHCAMERA_SEQUENCECAMERA, tr("Sequence Camera")).SetCheckable(true)
|
||||
@@ -849,12 +842,6 @@ void MainWindow::InitActions()
|
||||
am->AddAction(ID_SWITCHCAMERA_NEXT, tr("Cycle Camera"))
|
||||
.SetShortcut(tr("Ctrl+`"))
|
||||
.SetToolTip(tr("Cycle Camera (Ctrl+`)"));
|
||||
am->AddAction(ID_CHANGEMOVESPEED_INCREASE, tr("Increase"))
|
||||
.SetStatusTip(tr("Increase Flycam Movement Speed"));
|
||||
am->AddAction(ID_CHANGEMOVESPEED_DECREASE, tr("Decrease"))
|
||||
.SetStatusTip(tr("Decrease Flycam Movement Speed"));
|
||||
am->AddAction(ID_CHANGEMOVESPEED_CHANGESTEP, tr("Change Step"))
|
||||
.SetStatusTip(tr("Change Flycam Movement Step"));
|
||||
am->AddAction(ID_DISPLAY_GOTOPOSITION, tr("Go to Position..."));
|
||||
am->AddAction(ID_MODIFY_GOTO_SELECTION, tr("Center on Selection"))
|
||||
.SetShortcut(tr("Z"))
|
||||
|
||||
@@ -43,7 +43,7 @@ CNewLevelDialog::CNewLevelDialog(QWidget* pParent /*=NULL*/)
|
||||
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setWindowTitle(tr("New Level"));
|
||||
setMaximumSize(QSize(320, 280));
|
||||
setMaximumSize(QSize(430, 280));
|
||||
adjustSize();
|
||||
|
||||
// Default level folder is root (Levels/)
|
||||
|
||||
@@ -6,30 +6,30 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>320</width>
|
||||
<width>430</width>
|
||||
<height>280</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="PLACEHOLDER_TRN">
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="PLACEHOLDER_TRN">
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="STATIC_GROUP1">
|
||||
<property name="title">
|
||||
<string>Level</string>
|
||||
<string>Assign a name and location to the new level.</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="STATIC2">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
<string>Name</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
@@ -48,8 +48,14 @@
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="STATIC1">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Folder:</string>
|
||||
<string>Location</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
|
||||
@@ -1277,7 +1277,6 @@ void CEntityObject::OnEvent(ObjectEvent event)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
AZ_TracePrintf("CEntityObject", "Unhandled object event: %d", event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set (PAL_TRAIT_BUILD_EDITOR_APPLICATION_TYPE APPLICATION)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set (PAL_TRAIT_BUILD_EDITOR_APPLICATION_TYPE APPLICATION)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set (PAL_TRAIT_BUILD_EDITOR_APPLICATION_TYPE APPLICATION)
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
// AzToolsFramework
|
||||
#include <AzToolsFramework/API/ComponentEntityObjectBus.h>
|
||||
#include <AzToolsFramework/API/ComponentEntitySelectionBus.h>
|
||||
#include <AzToolsFramework/Editor/EditorContextMenuBus.h>
|
||||
#include <AzToolsFramework/Manipulators/ManipulatorManager.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorInteractionSystemViewportSelectionRequestBus.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorSelectionUtil.h>
|
||||
@@ -112,20 +113,20 @@ static const char TextCantCreateCameraNoLevel[] = "Cannot create camera when no
|
||||
|
||||
class EditorEntityNotifications
|
||||
: public AzToolsFramework::EditorEntityContextNotificationBus::Handler
|
||||
, public AzToolsFramework::EditorEvents::Bus::Handler
|
||||
, public AzToolsFramework::EditorContextMenuBus::Handler
|
||||
{
|
||||
public:
|
||||
EditorEntityNotifications(CRenderViewport& renderViewport)
|
||||
: m_renderViewport(renderViewport)
|
||||
{
|
||||
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorContextMenuBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
~EditorEntityNotifications() override
|
||||
{
|
||||
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorContextMenuBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
// AzToolsFramework::EditorEntityContextNotificationBus
|
||||
@@ -138,7 +139,7 @@ public:
|
||||
m_renderViewport.OnStopPlayInEditor();
|
||||
}
|
||||
|
||||
// AzToolsFramework::EditorEvents::Bus
|
||||
// AzToolsFramework::EditorContextMenu::Bus
|
||||
void PopulateEditorGlobalContextMenu(QMenu* menu, const AZ::Vector2& point, int flags) override
|
||||
{
|
||||
m_renderViewport.PopulateEditorGlobalContextMenu(menu, point, flags);
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
virtual void OnStartPlayInEditor();
|
||||
virtual void OnStopPlayInEditor();
|
||||
|
||||
// AzToolsFramework::EditorEvents::Bus (handler moved to cpp to resolve link issues in unity builds)
|
||||
// AzToolsFramework::EditorContextMenu::Bus (handler moved to cpp to resolve link issues in unity builds)
|
||||
// We use this to determine when the viewport context menu is being displayed so we can exit move mode
|
||||
void PopulateEditorGlobalContextMenu(QMenu* /*menu*/, const AZ::Vector2& /*point*/, int /*flags*/);
|
||||
|
||||
|
||||
@@ -89,9 +89,6 @@
|
||||
#define ID_EXPORT_INDOORS 32915
|
||||
#define ID_VIEW_CYCLE2DVIEWPORT 32916
|
||||
#define ID_SNAPANGLE 32917
|
||||
#define ID_CHANGEMOVESPEED_INCREASE 32928
|
||||
#define ID_CHANGEMOVESPEED_DECREASE 32929
|
||||
#define ID_CHANGEMOVESPEED_CHANGESTEP 32930
|
||||
#define ID_PHYSICS_GETPHYSICSSTATE 32937
|
||||
#define ID_PHYSICS_RESETPHYSICSSTATE 32938
|
||||
#define ID_GAME_SYNCPLAYER 32941
|
||||
|
||||
@@ -208,22 +208,9 @@ WelcomeScreenDialog QLabel
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QLabel#titleLabel
|
||||
WelcomeScreenDialog QLabel#currentProjectLabel
|
||||
{
|
||||
font-size: 22px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QLabel#bodyLabel
|
||||
{
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QLabel[fontStyle="sectionTitle"], QLabel#titleLabel[fontStyle="sectionTitle"], QLabel#documentationLink
|
||||
{
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QPushButton
|
||||
@@ -232,36 +219,20 @@ WelcomeScreenDialog QPushButton
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QFrame#viewContainer
|
||||
{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QFrame#viewContainer[articleStyle="pinned"]
|
||||
{
|
||||
background: rgba(180,139,255,5%);
|
||||
border: 1px solid #B48BFF;
|
||||
box-shadow: 0 0 4px 0 rgba(0,0,0,50%);
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QWidget#articleViewContainerRoot
|
||||
{
|
||||
background: #111111;
|
||||
background: #444444;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QScrollArea#previewArea
|
||||
WelcomeScreenDialog QWidget#levelViewFTUEContainer
|
||||
{
|
||||
background-color: transparent;
|
||||
background: #282828;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QWidget#articleViewContents
|
||||
{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QFrame#imageFrame
|
||||
{
|
||||
background-color: transparent;
|
||||
QTableWidget#recentLevelTable::item {
|
||||
background-color: rgb(64,64,64);
|
||||
margin-bottom: 4px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* Particle Editor */
|
||||
|
||||
@@ -116,6 +116,8 @@ void CTrackViewDialog::RegisterViewClass()
|
||||
AzToolsFramework::ViewPaneOptions opts;
|
||||
opts.shortcut = QKeySequence(Qt::Key_T);
|
||||
opts.isDisabledInSimMode = true;
|
||||
opts.showOnToolsToolbar = true;
|
||||
opts.toolbarIcon = ":/Menu/trackview_editor.svg";
|
||||
|
||||
AzToolsFramework::RegisterViewPane<CTrackViewDialog>(LyViewPane::TrackView, LyViewPane::CategoryTools, opts);
|
||||
GetIEditor()->GetSettingsManager()->AddToolName(s_kTrackViewLayoutSection, LyViewPane::TrackView);
|
||||
|
||||
@@ -154,11 +154,6 @@ void CViewportTitleDlg::SetupCameraDropdownMenu()
|
||||
QAction* gotoPositionAction = new QAction("Go to position", cameraMenu);
|
||||
connect(gotoPositionAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedGotoPosition);
|
||||
cameraMenu->addAction(gotoPositionAction);
|
||||
m_syncPlayerToCameraAction = new QAction("Sync camera to player", cameraMenu);
|
||||
m_syncPlayerToCameraAction->setCheckable(true);
|
||||
connect(m_syncPlayerToCameraAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedSyncplayer);
|
||||
cameraMenu->addAction(m_syncPlayerToCameraAction);
|
||||
|
||||
cameraMenu->addSeparator();
|
||||
|
||||
auto cameraSpeedActionWidget = new QWidgetAction(cameraMenu);
|
||||
@@ -175,7 +170,7 @@ void CViewportTitleDlg::SetupCameraDropdownMenu()
|
||||
cameraSpeedActionWidget->setDefaultWidget(cameraSpeedContainer);
|
||||
|
||||
// Save off the move speed here since setting up the combo box can cause it to update values in the background.
|
||||
float cameraMoveSpeed = gSettings.cameraMoveSpeed;
|
||||
const float cameraMoveSpeed = SandboxEditor::UsingNewCameraSystem() ? SandboxEditor::CameraTranslateSpeed() : gSettings.cameraMoveSpeed;
|
||||
|
||||
// Populate the presets in the ComboBox
|
||||
for (float presetValue : m_speedPresetValues)
|
||||
@@ -186,7 +181,8 @@ void CViewportTitleDlg::SetupCameraDropdownMenu()
|
||||
auto comboBoxTextChanged = static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentTextChanged);
|
||||
|
||||
SetSpeedComboBox(cameraMoveSpeed);
|
||||
m_cameraSpeed->setInsertPolicy(QComboBox::NoInsert);
|
||||
m_cameraSpeed->setInsertPolicy(QComboBox::InsertAtBottom);
|
||||
m_cameraSpeed->setDuplicatesEnabled(false);
|
||||
connect(m_cameraSpeed, comboBoxTextChanged, this, &CViewportTitleDlg::OnUpdateMoveSpeedText);
|
||||
connect(m_cameraSpeed->lineEdit(), &QLineEdit::returnPressed, this, &CViewportTitleDlg::OnSpeedComboBoxEnter);
|
||||
|
||||
@@ -238,47 +234,35 @@ void CViewportTitleDlg::SetupOverflowMenu()
|
||||
overFlowMenu->addAction(m_enableGridSnappingAction);
|
||||
|
||||
m_gridSizeActionWidget = new QWidgetAction(overFlowMenu);
|
||||
auto gridSizeContainer = new QWidget(overFlowMenu);
|
||||
auto gridSizeLabel = new QLabel(tr("Grid Size"), overFlowMenu);
|
||||
|
||||
m_gridSpinBox = new AzQtComponents::DoubleSpinBox();
|
||||
m_gridSpinBox->setValue(SandboxEditor::GridSnappingSize());
|
||||
m_gridSpinBox->setMinimum(1e-2f);
|
||||
m_gridSpinBox->setToolTip(tr("Grid size"));
|
||||
|
||||
QObject::connect(
|
||||
m_gridSpinBox, QOverload<double>::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &CViewportTitleDlg::OnGridSpinBoxChanged);
|
||||
|
||||
QHBoxLayout* gridSizeLayout = new QHBoxLayout;
|
||||
gridSizeLayout->addWidget(gridSizeLabel);
|
||||
gridSizeLayout->addWidget(m_gridSpinBox);
|
||||
gridSizeContainer->setLayout(gridSizeLayout);
|
||||
m_gridSizeActionWidget->setDefaultWidget(gridSizeContainer);
|
||||
m_gridSizeActionWidget->setDefaultWidget(m_gridSpinBox);
|
||||
overFlowMenu->addAction(m_gridSizeActionWidget);
|
||||
|
||||
overFlowMenu->addSeparator();
|
||||
|
||||
m_enableAngleSnappingAction = new QAction("Enable Grid Snapping", overFlowMenu);
|
||||
m_enableAngleSnappingAction = new QAction("Enable Angle Snapping", overFlowMenu);
|
||||
connect(m_enableAngleSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnAngleSnappingToggled);
|
||||
m_enableAngleSnappingAction->setCheckable(true);
|
||||
overFlowMenu->addAction(m_enableAngleSnappingAction);
|
||||
|
||||
m_angleSizeActionWidget = new QWidgetAction(overFlowMenu);
|
||||
auto angleSizeContainer = new QWidget(overFlowMenu);
|
||||
auto angleSizeLabel = new QLabel(tr("Angle Snapping"), overFlowMenu);
|
||||
|
||||
m_angleSpinBox = new AzQtComponents::DoubleSpinBox();
|
||||
m_angleSpinBox->setValue(SandboxEditor::AngleSnappingSize());
|
||||
m_angleSpinBox->setMinimum(1e-2f);
|
||||
m_angleSpinBox->setToolTip(tr("Angle Snapping"));
|
||||
|
||||
QObject::connect(
|
||||
m_angleSpinBox, QOverload<double>::of(&AzQtComponents::DoubleSpinBox::valueChanged), this,
|
||||
&CViewportTitleDlg::OnAngleSpinBoxChanged);
|
||||
|
||||
QHBoxLayout* angleSizeLayout = new QHBoxLayout;
|
||||
angleSizeLayout->addWidget(angleSizeLabel);
|
||||
angleSizeLayout->addWidget(m_angleSpinBox);
|
||||
angleSizeContainer->setLayout(angleSizeLayout);
|
||||
m_angleSizeActionWidget->setDefaultWidget(angleSizeContainer);
|
||||
m_angleSizeActionWidget->setDefaultWidget(m_angleSpinBox);
|
||||
overFlowMenu->addAction(m_angleSizeActionWidget);
|
||||
|
||||
m_ui->m_overflowBtn->setMenu(overFlowMenu);
|
||||
@@ -850,14 +834,6 @@ bool CViewportTitleDlg::eventFilter(QObject* object, QEvent* event)
|
||||
return QWidget::eventFilter(object, event) || consumeEvent;
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnBnClickedSyncplayer()
|
||||
{
|
||||
emit ActionTriggered(ID_GAME_SYNCPLAYER);
|
||||
|
||||
bool bSyncPlayer = GetIEditor()->GetGameEngine()->IsSyncPlayerPosition();
|
||||
m_syncPlayerToCameraAction->setChecked(!bSyncPlayer);
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::OnBnClickedGotoPosition()
|
||||
{
|
||||
emit ActionTriggered(ID_DISPLAY_GOTOPOSITION);
|
||||
@@ -926,15 +902,24 @@ void CViewportTitleDlg::OnSpeedComboBoxEnter()
|
||||
|
||||
void CViewportTitleDlg::OnUpdateMoveSpeedText(const QString& text)
|
||||
{
|
||||
gSettings.cameraMoveSpeed = aznumeric_cast<float>(Round(text.toDouble(), m_speedStep));
|
||||
if (SandboxEditor::UsingNewCameraSystem())
|
||||
{
|
||||
SandboxEditor::SetCameraTranslateSpeed(aznumeric_cast<float>(Round(text.toDouble(), m_speedStep)));
|
||||
}
|
||||
else
|
||||
{
|
||||
gSettings.cameraMoveSpeed = aznumeric_cast<float>(Round(text.toDouble(), m_speedStep));
|
||||
}
|
||||
}
|
||||
|
||||
void CViewportTitleDlg::CheckForCameraSpeedUpdate()
|
||||
{
|
||||
if (gSettings.cameraMoveSpeed != m_prevMoveSpeed && !m_cameraSpeed->lineEdit()->hasFocus())
|
||||
if (const float currentCameraMoveSpeed =
|
||||
SandboxEditor::UsingNewCameraSystem() ? SandboxEditor::CameraTranslateSpeed() : gSettings.cameraMoveSpeed;
|
||||
currentCameraMoveSpeed != m_prevMoveSpeed && !m_cameraSpeed->lineEdit()->hasFocus())
|
||||
{
|
||||
m_prevMoveSpeed = gSettings.cameraMoveSpeed;
|
||||
SetSpeedComboBox(gSettings.cameraMoveSpeed);
|
||||
m_prevMoveSpeed = currentCameraMoveSpeed;
|
||||
SetSpeedComboBox(currentCameraMoveSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,13 +115,13 @@ protected:
|
||||
float m_prevMoveSpeed;
|
||||
|
||||
// Speed combobox/lineEdit settings
|
||||
double m_minSpeed = 0.1;
|
||||
double m_minSpeed = 0.01;
|
||||
double m_maxSpeed = 100.0;
|
||||
double m_speedStep = 0.1;
|
||||
int m_numDecimals = 1;
|
||||
double m_speedStep = 0.001;
|
||||
int m_numDecimals = 3;
|
||||
|
||||
// Speed presets
|
||||
float m_speedPresetValues[3] = { 0.1f, 1.0f, 10.0f };
|
||||
float m_speedPresetValues[4] = { 0.01f, 0.1f, 1.0f, 10.0f };
|
||||
|
||||
double m_fieldWidthMultiplier = 1.8;
|
||||
|
||||
@@ -143,7 +143,6 @@ protected:
|
||||
void SetFullViewportInfo();
|
||||
void SetCompactViewportInfo();
|
||||
|
||||
void OnBnClickedSyncplayer();
|
||||
void OnBnClickedGotoPosition();
|
||||
void OnBnClickedMuteAudio();
|
||||
void OnBnClickedEnableVR();
|
||||
@@ -174,7 +173,6 @@ protected:
|
||||
QAction* m_fullInformationAction = nullptr;
|
||||
QAction* m_compactInformationAction = nullptr;
|
||||
QAction* m_debugHelpersAction = nullptr;
|
||||
QAction* m_syncPlayerToCameraAction = nullptr;
|
||||
QAction* m_audioMuteAction = nullptr;
|
||||
QAction* m_enableVRAction = nullptr;
|
||||
QAction* m_enableGridSnappingAction = nullptr;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:263e95489560dac6e5944ef3caba13e598f83ddead324b943ad7735ba015e1a9
|
||||
size 70727
|
||||
@@ -15,7 +15,8 @@
|
||||
#include "WelcomeScreenDialog.h"
|
||||
|
||||
// Qt
|
||||
#include <QStringListModel>
|
||||
#include <QTableWidget>
|
||||
#include <QTableWidgetItem>
|
||||
#include <QToolTip>
|
||||
#include <QMenu>
|
||||
#include <QDesktopServices>
|
||||
@@ -24,6 +25,7 @@
|
||||
#include <QScreen>
|
||||
#include <QDesktopWidget>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
|
||||
@@ -74,65 +76,39 @@ static int GetSmallestScreenHeight()
|
||||
WelcomeScreenDialog::WelcomeScreenDialog(QWidget* pParent)
|
||||
: QDialog(new WindowDecorationWrapper(WindowDecorationWrapper::OptionAutoAttach | WindowDecorationWrapper::OptionAutoTitleBarButtons, pParent), Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint | Qt::WindowTitleHint)
|
||||
, ui(new Ui::WelcomeScreenDialog)
|
||||
, m_pRecentListModel(new QStringListModel(this))
|
||||
, m_pRecentList(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// Make our welcome screen checkboxes appear as toggle switches
|
||||
AzQtComponents::CheckBox::applyToggleSwitchStyle(ui->autoLoadLevel);
|
||||
AzQtComponents::CheckBox::applyToggleSwitchStyle(ui->showOnStartup);
|
||||
ui->recentLevelTable->setColumnCount(3);
|
||||
ui->recentLevelTable->setMouseTracking(true);
|
||||
ui->recentLevelTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
ui->recentLevelTable->horizontalHeader()->hide();
|
||||
ui->recentLevelTable->verticalHeader()->hide();
|
||||
ui->recentLevelTable->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
ui->recentLevelTable->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
ui->recentLevelTable->setIconSize(QSize(20, 20));
|
||||
installEventFilter(this);
|
||||
|
||||
ui->autoLoadLevel->setChecked(gSettings.bAutoloadLastLevelAtStartup);
|
||||
ui->showOnStartup->setChecked(!gSettings.bShowDashboardAtStartup);
|
||||
|
||||
ui->recentLevelList->setModel(m_pRecentListModel);
|
||||
ui->recentLevelList->setMouseTracking(true);
|
||||
ui->recentLevelList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
auto currentProjectButtonMenu = new QMenu();
|
||||
|
||||
ui->currentProjectButton->setMenu(currentProjectButtonMenu);
|
||||
auto projectName = AZ::Utils::GetProjectName();
|
||||
ui->currentProjectButton->setText(projectName.c_str());
|
||||
ui->currentProjectButton->adjustSize();
|
||||
ui->currentProjectButton->setMinimumWidth(ui->currentProjectButton->width() + 40);
|
||||
ui->currentProjectName->setText(projectName.c_str());
|
||||
|
||||
ui->documentationLink->setCursor(Qt::PointingHandCursor);
|
||||
ui->documentationLink->installEventFilter(this);
|
||||
ui->newLevelButton->setDefault(true);
|
||||
|
||||
connect(ui->recentLevelList, &QWidget::customContextMenuRequested, this, &WelcomeScreenDialog::OnShowContextMenu);
|
||||
// Hide these buttons until the new functionality is added
|
||||
ui->gridButton->hide();
|
||||
ui->objectListButton->hide();
|
||||
ui->switchProjectButton->hide();
|
||||
|
||||
connect(ui->recentLevelList, &QListView::entered, this, &WelcomeScreenDialog::OnShowToolTip);
|
||||
connect(ui->recentLevelList, &QListView::clicked, this, &WelcomeScreenDialog::OnRecentLevelListItemClicked);
|
||||
connect(ui->recentLevelTable, &QWidget::customContextMenuRequested, this, &WelcomeScreenDialog::OnShowContextMenu);
|
||||
|
||||
connect(ui->recentLevelTable, &QTableWidget::entered, this, &WelcomeScreenDialog::OnShowToolTip);
|
||||
connect(ui->recentLevelTable, &QTableWidget::clicked, this, &WelcomeScreenDialog::OnRecentLevelTableItemClicked);
|
||||
|
||||
connect(ui->newLevelButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnNewLevelBtnClicked);
|
||||
connect(ui->levelFileLabel, &QLabel::linkActivated, this, &WelcomeScreenDialog::OnNewLevelLabelClicked);
|
||||
connect(ui->openLevelButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnOpenLevelBtnClicked);
|
||||
|
||||
connect(ui->newSliceButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnNewSliceBtnClicked);
|
||||
connect(ui->openSliceButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnOpenSliceBtnClicked);
|
||||
|
||||
connect(ui->documentationButton, &QPushButton::clicked, this, &WelcomeScreenDialog::OnDocumentationBtnClicked);
|
||||
connect(ui->showOnStartup, &QCheckBox::clicked, this, &WelcomeScreenDialog::OnShowOnStartupBtnClicked);
|
||||
connect(ui->autoLoadLevel, &QCheckBox::clicked, this, &WelcomeScreenDialog::OnAutoLoadLevelBtnClicked);
|
||||
|
||||
m_manifest = new News::ResourceManifest(
|
||||
std::bind(&WelcomeScreenDialog::SyncSuccess, this),
|
||||
std::bind(&WelcomeScreenDialog::SyncFail, this, std::placeholders::_1),
|
||||
std::bind(&WelcomeScreenDialog::SyncUpdate, this, std::placeholders::_1, std::placeholders::_2));
|
||||
|
||||
m_articleViewContainer = new News::ArticleViewContainer(this, *m_manifest);
|
||||
connect(m_articleViewContainer, &News::ArticleViewContainer::scrolled,
|
||||
this, &WelcomeScreenDialog::previewAreaScrolled);
|
||||
ui->articleViewContainerRoot->layout()->addWidget(m_articleViewContainer);
|
||||
|
||||
m_manifest->Sync();
|
||||
|
||||
#ifndef ENABLE_SLICE_EDITOR
|
||||
ui->newSliceButton->hide();
|
||||
ui->openSliceButton->hide();
|
||||
#endif
|
||||
|
||||
// Adjust the height, if need be
|
||||
// Do it in the constructor so that the WindowDecoratorWrapper handles it correctly
|
||||
int smallestHeight = GetSmallestScreenHeight();
|
||||
@@ -153,16 +129,10 @@ WelcomeScreenDialog::WelcomeScreenDialog(QWidget* pParent)
|
||||
WelcomeScreenDialog::~WelcomeScreenDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete m_manifest;
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::done(int result)
|
||||
{
|
||||
if (m_waitingOnAsync)
|
||||
{
|
||||
m_manifest->Abort();
|
||||
}
|
||||
|
||||
QDialog::done(result);
|
||||
}
|
||||
|
||||
@@ -173,13 +143,11 @@ const QString& WelcomeScreenDialog::GetLevelPath()
|
||||
|
||||
bool WelcomeScreenDialog::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched == ui->documentationLink)
|
||||
if (event->type() == QEvent::Show)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonRelease)
|
||||
{
|
||||
OnDocumentationBtnClicked(false);
|
||||
return true;
|
||||
}
|
||||
ui->recentLevelTable->horizontalHeader()->resizeSection(0, ui->nameLabel->width());
|
||||
ui->recentLevelTable->horizontalHeader()->resizeSection(1, ui->modifiedLabel->width());
|
||||
ui->recentLevelTable->horizontalHeader()->resizeSection(2, ui->typeLabel->width());
|
||||
}
|
||||
|
||||
return QDialog::eventFilter(watched, event);
|
||||
@@ -207,7 +175,9 @@ void WelcomeScreenDialog::SetRecentFileList(RecentFileList* pList)
|
||||
int nCurDir = sCurDir.length();
|
||||
|
||||
int recentListSize = pList->GetSize();
|
||||
for (int i = 0; i < recentListSize; ++i)
|
||||
int currentRow = 0;
|
||||
ui->recentLevelTable->setRowCount(recentListSize);
|
||||
for (int i = 0; i < recentListSize; ++i)
|
||||
{
|
||||
const QString& recentFile = pList->m_arrNames[i];
|
||||
if (recentFile.endsWith(m_levelExtension))
|
||||
@@ -218,7 +188,7 @@ void WelcomeScreenDialog::SetRecentFileList(RecentFileList* pList)
|
||||
if (sCurEntryDir.compare(sCurDir, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
QString fullPath = recentFile;
|
||||
QString name = Path::GetFileName(fullPath);
|
||||
const QString name = Path::GetFile(fullPath);
|
||||
|
||||
Path::ConvertSlashToBackSlash(fullPath);
|
||||
fullPath = Path::ToUnixPath(fullPath.toLower());
|
||||
@@ -226,18 +196,34 @@ void WelcomeScreenDialog::SetRecentFileList(RecentFileList* pList)
|
||||
|
||||
if (fullPath.contains(gamePath))
|
||||
{
|
||||
m_pRecentListModel->setStringList(m_pRecentListModel->stringList() << QString(name));
|
||||
if (gSettings.prefabSystem)
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(":/Level/level.svg"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
ui->recentLevelTable->setItem(currentRow, 0, new QTableWidgetItem(icon, name));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->recentLevelTable->setItem(currentRow, 0, new QTableWidgetItem(name));
|
||||
}
|
||||
QFileInfo file(recentFile);
|
||||
QDateTime dateTime = file.lastModified();
|
||||
QString date = QLocale::system().toString(dateTime.date(), QLocale::ShortFormat) + " " +
|
||||
QLocale::system().toString(dateTime.time(), QLocale::LongFormat);
|
||||
ui->recentLevelTable->setItem(currentRow, 1, new QTableWidgetItem(date));
|
||||
ui->recentLevelTable->setItem(currentRow++, 2, new QTableWidgetItem(tr("Level")));
|
||||
m_levels.push_back(std::make_pair(name, recentFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ui->recentLevelTable->setRowCount(currentRow);
|
||||
ui->recentLevelTable->setMinimumHeight(currentRow * ui->recentLevelTable->verticalHeader()->defaultSectionSize());
|
||||
ui->recentLevelTable->setMaximumHeight(currentRow * ui->recentLevelTable->verticalHeader()->defaultSectionSize());
|
||||
ui->levelFileLabel->setVisible(currentRow ? false : true);
|
||||
|
||||
ui->recentLevelList->setCurrentIndex(QModelIndex());
|
||||
int rowSize = ui->recentLevelList->sizeHintForRow(0) + ui->recentLevelList->spacing() * 2;
|
||||
ui->recentLevelList->setMinimumHeight(m_pRecentListModel->rowCount() * rowSize);
|
||||
ui->recentLevelList->setMaximumHeight(m_pRecentListModel->rowCount() * rowSize);
|
||||
ui->recentLevelTable->setCurrentIndex(QModelIndex());
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +231,7 @@ void WelcomeScreenDialog::RemoveLevelEntry(int index)
|
||||
{
|
||||
TNamePathPair levelPath = m_levels[index];
|
||||
|
||||
m_pRecentListModel->removeRow(index);
|
||||
ui->recentLevelTable->removeRow(index);
|
||||
m_levels.erase(m_levels.begin() + index);
|
||||
|
||||
|
||||
@@ -284,21 +270,18 @@ void WelcomeScreenDialog::OnShowToolTip(const QModelIndex& index)
|
||||
{
|
||||
const QString& fullPath = m_levels[index.row()].second;
|
||||
|
||||
//TEMPORARY:Begin This can be put back once the main window is in Qt
|
||||
//QRect itemRect = ui->recentLevelList->visualRect(index);
|
||||
QToolTip::showText(QCursor::pos(), QString("Open level: %1").arg(fullPath) /*, ui->recentLevelList, itemRect*/);
|
||||
//TEMPORARY:END
|
||||
QToolTip::showText(QCursor::pos(), QString("Open level: %1").arg(fullPath));
|
||||
}
|
||||
|
||||
|
||||
void WelcomeScreenDialog::OnShowContextMenu(const QPoint& pos)
|
||||
{
|
||||
QModelIndex index = ui->recentLevelList->indexAt(pos);
|
||||
QModelIndex index = ui->recentLevelTable->indexAt(pos);
|
||||
if (index.isValid())
|
||||
{
|
||||
QString level = m_pRecentListModel->data(index, 0).toString();
|
||||
QString level = ui->recentLevelTable->itemAt(pos)->text();
|
||||
|
||||
QPoint globalPos = ui->recentLevelList->viewport()->mapToGlobal(pos);
|
||||
QPoint globalPos = ui->recentLevelTable->viewport()->mapToGlobal(pos);
|
||||
|
||||
QMenu contextMenu;
|
||||
contextMenu.addAction(QString("Remove " + level + " from recent list"));
|
||||
@@ -310,13 +293,16 @@ void WelcomeScreenDialog::OnShowContextMenu(const QPoint& pos)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WelcomeScreenDialog::OnNewLevelBtnClicked([[maybe_unused]] bool checked)
|
||||
{
|
||||
m_levelPath = "new";
|
||||
accept();
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnNewLevelLabelClicked([[maybe_unused]] const QString& path)
|
||||
{
|
||||
OnNewLevelBtnClicked(true);
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnOpenLevelBtnClicked([[maybe_unused]] bool checked)
|
||||
{
|
||||
@@ -329,27 +315,7 @@ void WelcomeScreenDialog::OnOpenLevelBtnClicked([[maybe_unused]] bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnNewSliceBtnClicked([[maybe_unused]] bool checked)
|
||||
{
|
||||
m_levelPath = "new slice";
|
||||
accept();
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnOpenSliceBtnClicked(bool)
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(MainWindow::instance(),
|
||||
tr("Open Slice"),
|
||||
Path::GetEditingGameDataFolder().c_str(),
|
||||
tr("Slice (*.slice)"));
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
m_levelPath = fileName;
|
||||
accept();
|
||||
}
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnRecentLevelListItemClicked(const QModelIndex& modelIndex)
|
||||
void WelcomeScreenDialog::OnRecentLevelTableItemClicked(const QModelIndex& modelIndex)
|
||||
{
|
||||
int index = modelIndex.row();
|
||||
|
||||
@@ -365,45 +331,6 @@ void WelcomeScreenDialog::OnCloseBtnClicked([[maybe_unused]] bool checked)
|
||||
accept();
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnAutoLoadLevelBtnClicked(bool checked)
|
||||
{
|
||||
gSettings.bAutoloadLastLevelAtStartup = checked;
|
||||
gSettings.Save();
|
||||
}
|
||||
|
||||
|
||||
void WelcomeScreenDialog::OnShowOnStartupBtnClicked(bool checked)
|
||||
{
|
||||
gSettings.bShowDashboardAtStartup = !checked;
|
||||
gSettings.Save();
|
||||
|
||||
if (gSettings.bShowDashboardAtStartup == false)
|
||||
{
|
||||
QMessageBox msgBox(AzToolsFramework::GetActiveWindow());
|
||||
msgBox.setWindowTitle(QObject::tr("Skip the Welcome dialog on startup"));
|
||||
msgBox.setText(QObject::tr("You may re-enable the Welcome dialog at any time by going to Edit > Editor Settings > Global Preferences in the menu bar."));
|
||||
msgBox.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::OnDocumentationBtnClicked([[maybe_unused]] bool checked)
|
||||
{
|
||||
QString webLink = tr("https://aws.amazon.com/lumberyard/support/");
|
||||
QDesktopServices::openUrl(QUrl(webLink));
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::SyncFail([[maybe_unused]] News::ErrorCode error)
|
||||
{
|
||||
m_articleViewContainer->AddErrorMessage();
|
||||
m_waitingOnAsync = false;
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::SyncSuccess()
|
||||
{
|
||||
m_articleViewContainer->PopulateArticles();
|
||||
m_waitingOnAsync = false;
|
||||
}
|
||||
|
||||
void WelcomeScreenDialog::previewAreaScrolled()
|
||||
{
|
||||
//this should only be reported once per session
|
||||
|
||||
@@ -52,13 +52,9 @@ private:
|
||||
Ui::WelcomeScreenDialog* ui;
|
||||
|
||||
QString m_levelPath;
|
||||
QStringListModel* m_pRecentListModel;
|
||||
TNameFullPathArray m_levels;
|
||||
RecentFileList* m_pRecentList;
|
||||
News::ResourceManifest* m_manifest = nullptr;
|
||||
News::ArticleViewContainer* m_articleViewContainer = nullptr;
|
||||
const char* m_levelExtension = nullptr;
|
||||
bool m_waitingOnAsync = true;
|
||||
bool m_messageScrollReported = false;
|
||||
|
||||
void RemoveLevelEntry(int index);
|
||||
@@ -66,19 +62,11 @@ private:
|
||||
void OnShowToolTip(const QModelIndex& index);
|
||||
void OnShowContextMenu(const QPoint& point);
|
||||
void OnNewLevelBtnClicked(bool checked);
|
||||
void OnNewLevelLabelClicked(const QString& checked);
|
||||
void OnOpenLevelBtnClicked(bool checked);
|
||||
void OnNewSliceBtnClicked(bool checked);
|
||||
void OnOpenSliceBtnClicked(bool checked);
|
||||
void OnRecentLevelListItemClicked(const QModelIndex& index);
|
||||
void OnGettingStartedBtnClicked(bool checked);
|
||||
void OnTutorialsBtnClicked(bool checked);
|
||||
void OnDocumentationBtnClicked(bool checked);
|
||||
void OnForumsBtnClicked(bool checked);
|
||||
void OnAutoLoadLevelBtnClicked(bool checked);
|
||||
void OnShowOnStartupBtnClicked(bool checked);
|
||||
void OnRecentLevelTableItemClicked(const QModelIndex& index);
|
||||
void OnCloseBtnClicked(bool checked);
|
||||
|
||||
void SyncUpdate(const QString& /* message */, News::LogType /* logType */) {}
|
||||
void SyncFail(News::ErrorCode error);
|
||||
void SyncSuccess();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="WelcomeScreenDialog">
|
||||
<file>WelcomeScreenDialogHeader.png</file>
|
||||
<file>DefaultActiveProject.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
<ui version="4.0">
|
||||
<class>WelcomeScreenDialog</class>
|
||||
<widget class="QWidget" name="WelcomeScreenDialog">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>945</width>
|
||||
<height>639</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -18,21 +21,21 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>945</width>
|
||||
<height>639</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>16777215</height>
|
||||
<width>945</width>
|
||||
<height>639</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::TabFocus</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Welcome to Open 3D Engine</string>
|
||||
<string>Welcome to O3DE</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
@@ -53,100 +56,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="projectViewContainer" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="projectViewContainer_layout" stretch="0,0,1,0,0">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="currentProjectLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current project:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="currentProjectButton">
|
||||
<property name="text">
|
||||
<string>Current Project Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: "black"</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="bodyContainer">
|
||||
<property name="spacing">
|
||||
@@ -165,20 +74,26 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="levelViewFTUEContainer" native="true">
|
||||
<widget class="QWidget" name="articleViewContainerRoot" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<width>183</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<width>183</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<layout class="QVBoxLayout" name="newsContainerLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -191,6 +106,143 @@
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="currentProjectLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Active project</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="activeProjectIcon">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>126</width>
|
||||
<height>167</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>126</width>
|
||||
<height>167</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="WelcomeScreenDialog.qrc">:/WelcomeScreenDialog/DefaultActiveProject.png</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="currentProjectName">
|
||||
<property name="text">
|
||||
<string>MyGame</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="switchProjectButton">
|
||||
<property name="text">
|
||||
<string>Switch project...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="levelViewFTUEContainer" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>762</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>762</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -227,7 +279,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open or create a level</string>
|
||||
<string>Recent Files</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>-1</number>
|
||||
@@ -255,16 +307,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListView" name="recentLevelList">
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -310,8 +352,26 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="newLevelButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New level...</string>
|
||||
<string>Create new...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -333,8 +393,67 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openLevelButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>156</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open level...</string>
|
||||
<string>Open...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="objectListButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Framework/AzQtComponents/AzQtComponents/Components/resources.qrc">
|
||||
<normaloff>:/stylesheet/img/UI20/toolbar/Object_list.svg</normaloff>:/stylesheet/img/UI20/toolbar/Object_list.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="gridButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Framework/AzQtComponents/AzQtComponents/Components/resources.qrc">
|
||||
<normaloff>:/stylesheet/img/UI20/toolbar/Grid.svg</normaloff>:/stylesheet/img/UI20/toolbar/Grid.svg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -358,65 +477,130 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="horizontalWidget_2" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="2,2,1">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="sliceControlContainer">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="newSliceButton">
|
||||
<property name="text">
|
||||
<string>New slice...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="openSliceButton">
|
||||
<property name="text">
|
||||
<string>Open slice...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="modifiedLabel">
|
||||
<property name="text">
|
||||
<string>Last modified</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="typeLabel">
|
||||
<property name="text">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="0,0,0">
|
||||
<property name="leftMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="levelFileLabel">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No level file created yet for this project. <a href="#">Create one</a> now.</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="recentLevelTable">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>1</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>48</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderHighlightSections">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="maximumSize">
|
||||
@@ -439,205 +623,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignHCenter">
|
||||
<widget class="QWidget" name="documentationLinkContainer" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="documentationButton">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>info</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/stylesheet/img/UI20/Info.svg</normaloff>:/stylesheet/img/UI20/Info.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="documentationLink">
|
||||
<property name="text">
|
||||
<string>Documentation and tutorials</string>
|
||||
</property>
|
||||
<property name="class" stdset="0">
|
||||
<string>link</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: "black"</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="articleViewContainerRoot" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="newsContainerLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: "black"</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QWidget" name="optionsViewContainer" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="optionsViewContainer_layout">
|
||||
<property name="spacing">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="autoLoadLevel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto-load last opened level on startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showOnStartup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Skip this dialog on startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="WelcomeScreenDialog.qrc"/>
|
||||
<include location="../../../Framework/AzQtComponents/AzQtComponents/Components/resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:53b846352880d940621b14b1ea9514e0a4c95aa6ead4d00234a98684c061c04f
|
||||
size 29505
|
||||
@@ -817,6 +817,8 @@ set(FILES
|
||||
EditorViewportWidget.h
|
||||
EditorViewportSettings.cpp
|
||||
EditorViewportSettings.h
|
||||
EditorViewportCamera.cpp
|
||||
EditorViewportCamera.h
|
||||
ViewportManipulatorController.cpp
|
||||
ViewportManipulatorController.h
|
||||
LegacyViewportCameraController.cpp
|
||||
|
||||
@@ -167,7 +167,7 @@ void SandboxIntegrationManager::Setup()
|
||||
AzToolsFramework::ToolsApplicationEvents::Bus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorRequests::Bus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorWindowRequests::Bus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorContextMenuBus::Handler::BusConnect();
|
||||
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
|
||||
AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusConnect();
|
||||
|
||||
@@ -384,7 +384,7 @@ void SandboxIntegrationManager::Teardown()
|
||||
AzFramework::DisplayContextRequestBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorContextMenuBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorWindowRequests::Bus::Handler::BusDisconnect();
|
||||
AzToolsFramework::EditorRequests::Bus::Handler::BusDisconnect();
|
||||
AzToolsFramework::ToolsApplicationEvents::Bus::Handler::BusDisconnect();
|
||||
@@ -589,6 +589,11 @@ void SandboxIntegrationManager::OnSaveLevel()
|
||||
m_unsavedEntities.clear();
|
||||
}
|
||||
|
||||
int SandboxIntegrationManager::GetMenuPosition() const
|
||||
{
|
||||
return aznumeric_cast<int>(AzToolsFramework::EditorContextMenuOrdering::TOP);
|
||||
}
|
||||
|
||||
void SandboxIntegrationManager::PopulateEditorGlobalContextMenu(QMenu* menu, const AZ::Vector2& point, int flags)
|
||||
{
|
||||
if (!IsLevelDocumentOpen())
|
||||
@@ -662,13 +667,6 @@ void SandboxIntegrationManager::PopulateEditorGlobalContextMenu(QMenu* menu, con
|
||||
|
||||
SetupSliceContextMenu(menu);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu->addSeparator();
|
||||
|
||||
// Allow handlers to append menu items to the context menu
|
||||
AzToolsFramework::EditorContextMenuBus::Broadcast(&AzToolsFramework::EditorContextMenuEvents::PopulateEditorGlobalContextMenu, menu);
|
||||
}
|
||||
|
||||
action = menu->addAction(QObject::tr("Duplicate"));
|
||||
QObject::connect(action, &QAction::triggered, action, [this] { ContextMenu_Duplicate(); });
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <AzFramework/Viewport/DisplayContextRequestBus.h>
|
||||
#include <AzToolsFramework/API/EditorWindowRequestBus.h>
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
#include <AzToolsFramework/Editor/EditorContextMenuBus.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorLayerComponentBus.h>
|
||||
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
|
||||
#include <AzToolsFramework/UI/Layer/LayerUiHandler.h>
|
||||
@@ -97,7 +98,7 @@ class SandboxIntegrationManager
|
||||
: private AzToolsFramework::ToolsApplicationEvents::Bus::Handler
|
||||
, private AzToolsFramework::EditorRequests::Bus::Handler
|
||||
, private AzToolsFramework::EditorPickModeNotificationBus::Handler
|
||||
, private AzToolsFramework::EditorEvents::Bus::Handler
|
||||
, private AzToolsFramework::EditorContextMenuBus::Handler
|
||||
, private AzToolsFramework::EditorWindowRequests::Bus::Handler
|
||||
, private AzFramework::AssetCatalogEventBus::Handler
|
||||
, private AzFramework::DisplayContextRequestBus::Handler
|
||||
@@ -184,8 +185,9 @@ private:
|
||||
void OnEntityPickModeStopped() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AzToolsFramework::EditorEvents::Bus::Handler overrides
|
||||
// AzToolsFramework::EditorContextMenu::Bus::Handler overrides
|
||||
void PopulateEditorGlobalContextMenu(QMenu* menu, const AZ::Vector2& point, int flags) override;
|
||||
int GetMenuPosition() const;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <AzQtComponents/Utilities/QtViewPaneEffects.h>
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
#include <AzToolsFramework/Commands/SelectionCommand.h>
|
||||
#include <AzToolsFramework/Editor/EditorContextMenuBus.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityHelpers.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityInfoBus.h>
|
||||
@@ -530,8 +531,8 @@ void OutlinerWidget::contextMenuEvent(QContextMenuEvent* event)
|
||||
QMenu* contextMenu = new QMenu(this);
|
||||
|
||||
// Populate global context menu.
|
||||
EBUS_EVENT(AzToolsFramework::EditorEvents::Bus,
|
||||
PopulateEditorGlobalContextMenu,
|
||||
|
||||
AzToolsFramework::EditorContextMenuBus::Broadcast(&AzToolsFramework::EditorContextMenuEvents::PopulateEditorGlobalContextMenu,
|
||||
contextMenu,
|
||||
AZ::Vector2::CreateZero(),
|
||||
AzToolsFramework::EditorEvents::eECMF_HIDE_ENTITY_CREATION | AzToolsFramework::EditorEvents::eECMF_USE_VIEWPORT_CENTER);
|
||||
|
||||
Reference in New Issue
Block a user