diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index ecbdde7f13..4725101599 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -33,9 +33,7 @@ AZ_POP_DISABLE_WARNING #include #include #include -#include #include -#include // Aws Native SDK #include @@ -71,12 +69,10 @@ AZ_POP_DISABLE_WARNING #include #include #include -#include #include // AzQtComponents #include -#include #include #include #include @@ -742,12 +738,10 @@ void CCryEditApp::OnFileSave() } else { - //auto prefabSystemComponentInterface = AZ::Interface::Get(); auto prefabEditorEntityOwnershipService = AZ::Interface::Get(); AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = prefabEditorEntityOwnershipService->GetRootPrefabTemplateId(); auto prefabIntegrationInterface = AZ::Interface::Get(); - prefabIntegrationInterface->ExecuteSavePrefabsDialog(rootPrefabTemplateId, true); - // prefabSystemComponentInterface->AreDirtyTemplatesPresent(rootPrefabTemplateId) + prefabIntegrationInterface->ExecuteSavePrefabDialog(rootPrefabTemplateId, true); } } @@ -3204,13 +3198,6 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled) switch (1 - prefabSaveSelection) { case QDialogButtonBox::AcceptRole: - if (!GetIEditor()->GetDocument()->DoFileSave()) - { - // if the file save operation failed, assume that the user was informed of why - // already and treat it as a cancel - wasCreateLevelOperationCancelled = true; - return false; - } bIsDocModified = false; break; case QDialogButtonBox::RejectRole: diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index 3fb39d4268..2985f9fec2 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -13,16 +13,7 @@ // Qt #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include // AzCore #include diff --git a/Code/Editor/EditorPreferencesPageGeneral.cpp b/Code/Editor/EditorPreferencesPageGeneral.cpp index 4721944b18..2cba7e7801 100644 --- a/Code/Editor/EditorPreferencesPageGeneral.cpp +++ b/Code/Editor/EditorPreferencesPageGeneral.cpp @@ -97,7 +97,7 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize) ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_restoreViewportCamera, EditorPreferencesGeneralRestoreViewportCameraSettingName, "Keep the original editor viewport transform when exiting game mode.") ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enableSceneInspector, "Enable Scene Inspector (EXPERIMENTAL)", "Enable the option to inspect the internal data loaded from scene files like .fbx. This is an experimental feature. Restart the Scene Settings if the option is not visible under the Help menu."); - editContext->Class("Global Save Settings (File > Save & Ctrl+S)", "") + editContext->Class("Global Save Settings (File>Save & Ctrl+S)", "") ->DataElement( AZ::Edit::UIHandlers::ComboBox, &GlobalSaveSettings::m_saveAllPrefabsPreference, "Save Prefabs Preference", "This option controls whether prefabs should be saved along with the level") diff --git a/Code/Editor/Style/Editor.qss b/Code/Editor/Style/Editor.qss index 72ddeaee5a..3bf92b4495 100644 --- a/Code/Editor/Style/Editor.qss +++ b/Code/Editor/Style/Editor.qss @@ -245,11 +245,6 @@ QTableWidget#recentLevelTable::item { qproperty-iconSize: 16px 16px; } -QListWidget::item -{ - border : none; -} - #SavePrefabDialog, #SaveAllFilesDialog { min-width : 640px; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h index 68b9c1dabb..feb2fc12bf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h @@ -56,6 +56,5 @@ namespace AzToolsFramework virtual void StopPlayInEditor() = 0; virtual void CreateNewLevelPrefab(AZStd::string_view filename, const AZStd::string& templateFilename) = 0; - virtual bool IsRootTemplateDirty() = 0; }; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index 8994adc9af..c9365683b5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -617,11 +617,6 @@ namespace AzToolsFramework m_playInEditorData.m_isEnabled = false; } - bool PrefabEditorEntityOwnershipService::IsRootTemplateDirty() - { - return (m_prefabSystemComponent->IsTemplateDirty(m_rootInstance->GetTemplateId())); - } - ////////////////////////////////////////////////////////////////////////// // Slice Buses implementation with Assert(false), this will exist only during Slice->Prefab // development to pinpoint and replace specific calls to Slice system diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h index 962b197b5d..a98fce8059 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h @@ -196,7 +196,6 @@ namespace AzToolsFramework Prefab::TemplateId GetRootPrefabTemplateId() override; const AZStd::vector>& GetPlayInEditorAssetData() override; - bool IsRootTemplateDirty() override; ////////////////////////////////////////////////////////////////////////// void OnEntityRemoved(AZ::EntityId entityId); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.cpp index 7b462e3a2f..8be3b402fa 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.cpp @@ -25,7 +25,7 @@ namespace AzToolsFramework { namespace Prefab { - static constexpr const char s_savePrefabsKey[] = "/O3DE/Preferences/SavePrefabs"; + static constexpr const char s_saveAllPrefabsKey[] = "/O3DE/Preferences/SaveAllPrefabs"; void PrefabLoader::Reflect(AZ::ReflectContext* context) { @@ -674,7 +674,7 @@ namespace AzToolsFramework SaveAllPrefabsPreference saveAllPrefabsPreference = SaveAllPrefabsPreference::AskEveryTime; if (auto* registry = AZ::SettingsRegistry::Get()) { - registry->GetObject(saveAllPrefabsPreference, s_savePrefabsKey); + registry->GetObject(saveAllPrefabsPreference, s_saveAllPrefabsKey); } return saveAllPrefabsPreference; } @@ -683,7 +683,7 @@ namespace AzToolsFramework { if (auto* registry = AZ::SettingsRegistry::Get()) { - registry->SetObject(s_savePrefabsKey, saveAllPrefabsPreference); + registry->SetObject(s_saveAllPrefabsKey, saveAllPrefabsPreference); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationInterface.h index afd764232d..f5f393f3b8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationInterface.h @@ -31,7 +31,7 @@ namespace AzToolsFramework virtual AZ::EntityId CreateNewEntityAtPosition(const AZ::Vector3& position, AZ::EntityId parentId) = 0; virtual int ExecuteClosePrefabDialog(TemplateId templateId) = 0; - virtual void ExecuteSavePrefabsDialog(TemplateId templateId, bool useSaveAllPrefabsPreference = false) = 0; + virtual void ExecuteSavePrefabDialog(TemplateId templateId, bool useSaveAllPrefabsPreference = false) = 0; }; } // namespace Prefab diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp index 825dea6072..42d8ec80bf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp @@ -1089,7 +1089,7 @@ namespace AzToolsFramework return prefabSaveSelection; } - void PrefabIntegrationManager::ExecuteSavePrefabsDialog(TemplateId templateId, bool useSaveAllPrefabsPreference) + void PrefabIntegrationManager::ExecuteSavePrefabDialog(TemplateId templateId, bool useSaveAllPrefabsPreference) { using namespace AzToolsFramework::Prefab; @@ -1120,14 +1120,14 @@ namespace AzToolsFramework } } - AZStd::unique_ptr savePrefabsDialog = ConstructSavePrefabsDialog(templateId, useSaveAllPrefabsPreference); - if (savePrefabsDialog) + AZStd::unique_ptr savePrefabDialog = ConstructSavePrefabDialog(templateId, useSaveAllPrefabsPreference); + if (savePrefabDialog) { - int prefabSaveSelection = savePrefabsDialog->exec(); + int prefabSaveSelection = savePrefabDialog->exec(); if (prefabSaveSelection == QDialog::Accepted) { - SavePrefabsInDialog(savePrefabsDialog.get()); + SavePrefabsInDialog(savePrefabDialog.get()); } } } @@ -1148,7 +1148,7 @@ namespace AzToolsFramework } } - AZStd::unique_ptr PrefabIntegrationManager::ConstructSavePrefabsDialog(TemplateId templateId, bool useSaveAllPrefabsPreference) + AZStd::unique_ptr PrefabIntegrationManager::ConstructSavePrefabDialog(TemplateId templateId, bool useSaveAllPrefabsPreference) { AZStd::unique_ptr saveModifiedMessageBox = AZStd::make_unique(AzToolsFramework::GetActiveWindow()); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.h index 8a210c2de0..64d3b652fc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.h @@ -77,7 +77,7 @@ namespace AzToolsFramework // PrefabIntegrationInterface... AZ::EntityId CreateNewEntityAtPosition(const AZ::Vector3& position, AZ::EntityId parentId) override; int ExecuteClosePrefabDialog(TemplateId templateId) override; - void ExecuteSavePrefabsDialog(TemplateId templateId, bool useSaveAllPrefabsPreference) override; + void ExecuteSavePrefabDialog(TemplateId templateId, bool useSaveAllPrefabsPreference) override; private: // Manages the Edit Mode UI for prefabs @@ -132,7 +132,7 @@ namespace AzToolsFramework AZStd::shared_ptr ConstructClosePrefabDialog(TemplateId templateId); AzQtComponents::Card* ConstructUnsavedPrefabsCard(TemplateId templateId); - AZStd::unique_ptr ConstructSavePrefabsDialog(TemplateId templateId, bool useSaveAllPrefabsPreference); + AZStd::unique_ptr ConstructSavePrefabDialog(TemplateId templateId, bool useSaveAllPrefabsPreference); void SavePrefabsInDialog(QDialog* unsavedPrefabsDialog);