Initial improvements to fix viewport icon selection and draw order (#6284)
* wip fixes for entity viewport icons displaying in the correct order and handling selection correctly Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add additional comment about z value Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * move manual sorting and some small tidy-up Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * update comment Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * updates following initial round of PR feedback Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * additional changes to support tests for entity icon intersection Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add support to enable/disable icons separately from helpers Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * final tests added and small tidy-up to display EntityId correctly Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * update some manipulator test framework calls after utility functions were moved Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * fix for implicit cast Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * move icon scale values to AZ_CVARS Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * fix failing tests caught in AR and update some naming conventions for tests Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * update naming convention for members of ProjectedViewportRay Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * update other references to ProjectedViewportRay Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * update more references to ProjectedViewportRay change Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * update menus for python tests Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
df8326a1b0
commit
d065eb9498
+65
-19
@@ -47,6 +47,7 @@ AZ_POP_DISABLE_WARNING
|
||||
#include <AzToolsFramework/API/EditorAnimationSystemRequestBus.h>
|
||||
#include <AzToolsFramework/SourceControl/QtSourceControlNotificationHandler.h>
|
||||
#include <AzToolsFramework/PythonTerminal/ScriptTermDialog.h>
|
||||
#include <AzToolsFramework/Viewport/ViewportSettings.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorTransformComponentSelectionRequestBus.h>
|
||||
|
||||
// AzQtComponents
|
||||
@@ -445,11 +446,11 @@ void MainWindow::Initialize()
|
||||
{
|
||||
m_viewPaneManager->SetMainWindow(m_viewPaneHost, &m_settings, /*unused*/ QByteArray());
|
||||
|
||||
InitActions();
|
||||
|
||||
RegisterStdViewClasses();
|
||||
InitCentralWidget();
|
||||
|
||||
InitActions();
|
||||
|
||||
// load toolbars ("shelves") and macros
|
||||
GetIEditor()->GetToolBoxManager()->Load(m_actionManager);
|
||||
|
||||
@@ -798,27 +799,40 @@ void MainWindow::InitActions()
|
||||
EditorTransformComponentSelectionRequests::Mode::Scale);
|
||||
});
|
||||
|
||||
am->AddAction(AzToolsFramework::SnapToGrid, tr("Snap to grid"))
|
||||
am->AddAction(AzToolsFramework::SnapToGrid, tr("Grid snapping"))
|
||||
.SetIcon(Style::icon("Grid"))
|
||||
.SetStatusTip(tr("Toggle grid snapping"))
|
||||
.SetShortcut(tr("G"))
|
||||
.SetToolTip(tr("Snap to grid (G)"))
|
||||
.SetStatusTip(tr("Toggles snap to grid"))
|
||||
.SetCheckable(true)
|
||||
.RegisterUpdateCallback([](QAction* action) {
|
||||
Q_ASSERT(action->isCheckable());
|
||||
action->setChecked(SandboxEditor::GridSnappingEnabled());
|
||||
})
|
||||
.Connect(&QAction::triggered, []() { SandboxEditor::SetGridSnapping(!SandboxEditor::GridSnappingEnabled()); });
|
||||
.RegisterUpdateCallback(
|
||||
[](QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
action->setChecked(SandboxEditor::GridSnappingEnabled());
|
||||
})
|
||||
.Connect(
|
||||
&QAction::triggered,
|
||||
[]
|
||||
{
|
||||
SandboxEditor::SetGridSnapping(!SandboxEditor::GridSnappingEnabled());
|
||||
});
|
||||
|
||||
am->AddAction(AzToolsFramework::SnapAngle, tr("Snap angle"))
|
||||
am->AddAction(AzToolsFramework::SnapAngle, tr("Angle snapping"))
|
||||
.SetIcon(Style::icon("Angle"))
|
||||
.SetStatusTip(tr("Snap angle"))
|
||||
.SetStatusTip(tr("Toggle angle snapping"))
|
||||
.SetCheckable(true)
|
||||
.RegisterUpdateCallback([](QAction* action) {
|
||||
Q_ASSERT(action->isCheckable());
|
||||
action->setChecked(SandboxEditor::AngleSnappingEnabled());
|
||||
})
|
||||
.Connect(&QAction::triggered, []() { SandboxEditor::SetAngleSnapping(!SandboxEditor::AngleSnappingEnabled()); });
|
||||
.RegisterUpdateCallback(
|
||||
[](QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
action->setChecked(SandboxEditor::AngleSnappingEnabled());
|
||||
})
|
||||
.Connect(
|
||||
&QAction::triggered,
|
||||
[]
|
||||
{
|
||||
SandboxEditor::SetAngleSnapping(!SandboxEditor::AngleSnappingEnabled());
|
||||
});
|
||||
|
||||
// Display actions
|
||||
am->AddAction(ID_SWITCHCAMERA_DEFAULTCAMERA, tr("Default Camera")).SetCheckable(true)
|
||||
@@ -918,9 +932,41 @@ void MainWindow::InitActions()
|
||||
.SetStatusTip(tr("Cycle 2D Viewport"))
|
||||
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateNonGameMode);
|
||||
#endif
|
||||
am->AddAction(ID_DISPLAY_SHOWHELPERS, tr("Show/Hide Helpers"))
|
||||
am->AddAction(AzToolsFramework::Helpers, tr("Show Helpers"))
|
||||
.SetShortcut(tr("Shift+Space"))
|
||||
.SetToolTip(tr("Show/Hide Helpers (Shift+Space)"));
|
||||
.SetToolTip(tr("Show/Hide Helpers (Shift+Space)"))
|
||||
.SetCheckable(true)
|
||||
.RegisterUpdateCallback(
|
||||
[](QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
action->setChecked(AzToolsFramework::HelpersVisible());
|
||||
})
|
||||
.Connect(
|
||||
&QAction::triggered,
|
||||
[]()
|
||||
{
|
||||
AzToolsFramework::SetHelpersVisible(!AzToolsFramework::HelpersVisible());
|
||||
AzToolsFramework::ViewportInteraction::ViewportSettingsNotificationBus::Broadcast(
|
||||
&AzToolsFramework::ViewportInteraction::ViewportSettingNotifications::OnDrawHelpersChanged,
|
||||
AzToolsFramework::HelpersVisible());
|
||||
});
|
||||
am->AddAction(AzToolsFramework::Icons, tr("Show Icons"))
|
||||
.SetShortcut(tr("Ctrl+Space"))
|
||||
.SetToolTip(tr("Show/Hide Icons (Ctrl+Space)"))
|
||||
.SetCheckable(true)
|
||||
.RegisterUpdateCallback(
|
||||
[](QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
action->setChecked(AzToolsFramework::IconsVisible());
|
||||
})
|
||||
.Connect(
|
||||
&QAction::triggered,
|
||||
[]()
|
||||
{
|
||||
AzToolsFramework::SetIconsVisible(!AzToolsFramework::IconsVisible());
|
||||
});
|
||||
|
||||
// Audio actions
|
||||
am->AddAction(ID_SOUND_STOPALLSOUNDS, tr("Stop All Sounds"))
|
||||
|
||||
Reference in New Issue
Block a user