|
@@ -2240,42 +2240,31 @@ namespace AzToolsFramework
|
|
RegenerateManipulators();
|
|
RegenerateManipulators();
|
|
});
|
|
});
|
|
|
|
|
|
- bool isPrefabSystemEnabled = false;
|
|
|
|
- AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
|
|
|
- isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
|
|
|
|
-
|
|
|
|
- bool prefabWipFeaturesEnabled = false;
|
|
|
|
- AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
|
|
|
- prefabWipFeaturesEnabled, &AzFramework::ApplicationRequests::ArePrefabWipFeaturesEnabled);
|
|
|
|
|
|
+ // duplicate selection
|
|
|
|
+ AddAction(
|
|
|
|
+ m_actions, { QKeySequence(Qt::CTRL + Qt::Key_D) },
|
|
|
|
+ /*ID_EDIT_CLONE =*/33525, s_duplicateTitle, s_duplicateDesc,
|
|
|
|
+ []()
|
|
|
|
+ {
|
|
|
|
+ AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
|
|
|
|
|
|
- if (!isPrefabSystemEnabled || (isPrefabSystemEnabled && prefabWipFeaturesEnabled))
|
|
|
|
- {
|
|
|
|
- // duplicate selection
|
|
|
|
- AddAction(
|
|
|
|
- m_actions, { QKeySequence(Qt::CTRL + Qt::Key_D) },
|
|
|
|
- /*ID_EDIT_CLONE =*/33525, s_duplicateTitle, s_duplicateDesc,
|
|
|
|
- []()
|
|
|
|
|
|
+ // Clear Widget selection - Prevents issues caused by cloning entities while a property in the Reflected Property Editor
|
|
|
|
+ // is being edited.
|
|
|
|
+ if (QApplication::focusWidget())
|
|
{
|
|
{
|
|
- AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
|
|
|
|
-
|
|
|
|
- // Clear Widget selection - Prevents issues caused by cloning entities while a property in the Reflected Property Editor
|
|
|
|
- // is being edited.
|
|
|
|
- if (QApplication::focusWidget())
|
|
|
|
- {
|
|
|
|
- QApplication::focusWidget()->clearFocus();
|
|
|
|
- }
|
|
|
|
|
|
+ QApplication::focusWidget()->clearFocus();
|
|
|
|
+ }
|
|
|
|
|
|
- ScopedUndoBatch undoBatch(s_duplicateUndoRedoDesc);
|
|
|
|
- auto selectionCommand = AZStd::make_unique<SelectionCommand>(EntityIdList(), s_duplicateUndoRedoDesc);
|
|
|
|
- selectionCommand->SetParent(undoBatch.GetUndoBatch());
|
|
|
|
- selectionCommand.release();
|
|
|
|
|
|
+ ScopedUndoBatch undoBatch(s_duplicateUndoRedoDesc);
|
|
|
|
+ auto selectionCommand = AZStd::make_unique<SelectionCommand>(EntityIdList(), s_duplicateUndoRedoDesc);
|
|
|
|
+ selectionCommand->SetParent(undoBatch.GetUndoBatch());
|
|
|
|
+ selectionCommand.release();
|
|
|
|
|
|
- bool handled = false;
|
|
|
|
- EditorRequestBus::Broadcast(&EditorRequests::CloneSelection, handled);
|
|
|
|
|
|
+ bool handled = false;
|
|
|
|
+ EditorRequestBus::Broadcast(&EditorRequests::CloneSelection, handled);
|
|
|
|
|
|
- // selection update handled in AfterEntitySelectionChanged
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ // selection update handled in AfterEntitySelectionChanged
|
|
|
|
+ });
|
|
|
|
|
|
// delete selection
|
|
// delete selection
|
|
AddAction(
|
|
AddAction(
|