31
31
#include < AzToolsFramework/ComponentMode/EditorComponentModeBus.h>
32
32
#include < AzToolsFramework/Slice/SliceUtilities.h>
33
33
#include < AzToolsFramework/UI/UICore/WidgetHelpers.h>
34
- #include < AzToolsFramework/UI/Layer/NameConflictWarning.hxx>
35
34
#include < AzToolsFramework/API/EditorLevelNotificationBus.h>
36
35
37
36
// Editor
@@ -928,12 +927,6 @@ bool CCryEditDoc::OnSaveDocument(const QString& lpszPathName)
928
927
929
928
bool CCryEditDoc::BeforeSaveDocument (const QString& lpszPathName, TSaveDocContext& context)
930
929
{
931
- // Don't save level data if any conflict exists
932
- if (HasLayerNameConflicts ())
933
- {
934
- return false ;
935
- }
936
-
937
930
// Restore directory to root.
938
931
QDir::setCurrent (GetIEditor ()->GetPrimaryCDFolder ());
939
932
@@ -954,35 +947,6 @@ bool CCryEditDoc::BeforeSaveDocument(const QString& lpszPathName, TSaveDocContex
954
947
return true ;
955
948
}
956
949
957
- bool CCryEditDoc::HasLayerNameConflicts () const
958
- {
959
- AZStd::vector<AZ::Entity*> editorEntities;
960
- AzToolsFramework::EditorEntityContextRequestBus::Broadcast (
961
- &AzToolsFramework::EditorEntityContextRequestBus::Events::GetLooseEditorEntities,
962
- editorEntities);
963
-
964
- AZStd::unordered_map<AZStd::string, int > nameConflictMapping;
965
- for (AZ::Entity* entity : editorEntities)
966
- {
967
- AzToolsFramework::Layers::EditorLayerComponentRequestBus::Event (
968
- entity->GetId (),
969
- &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::UpdateLayerNameConflictMapping,
970
- nameConflictMapping);
971
- }
972
-
973
- if (!nameConflictMapping.empty ())
974
- {
975
- AzToolsFramework::Layers::NameConflictWarning* nameConflictWarning = new AzToolsFramework::Layers::NameConflictWarning (
976
- MainWindow::instance (),
977
- nameConflictMapping);
978
- nameConflictWarning->exec ();
979
-
980
- return true ;
981
- }
982
-
983
- return false ;
984
- }
985
-
986
950
bool CCryEditDoc::DoSaveDocument (const QString& filename, TSaveDocContext& context)
987
951
{
988
952
bool & bSaved = context.bSaved ;
@@ -1201,38 +1165,6 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
1201
1165
&AzToolsFramework::EditorEntityContextRequestBus::Events::GetLooseEditorEntities,
1202
1166
editorEntities);
1203
1167
1204
- AZStd::vector<AZ::Entity*> layerEntities;
1205
- AZ::SliceComponent::SliceReferenceToInstancePtrs instancesInLayers;
1206
- for (AZ::Entity* entity : editorEntities)
1207
- {
1208
- AzToolsFramework::Layers::LayerResult layerSaveResult (AzToolsFramework::Layers::LayerResult::CreateSuccess ());
1209
- AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult (
1210
- layerSaveResult,
1211
- entity->GetId (),
1212
- &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::WriteLayerAndGetEntities,
1213
- newLevelFolder,
1214
- layerEntities,
1215
- instancesInLayers);
1216
- layerSaveResult.MessageResult ();
1217
- }
1218
-
1219
- AZ::IO::ByteContainerStream<AZStd::vector<char >> entitySaveStream (&entitySaveBuffer);
1220
- {
1221
- AZ_PROFILE_SCOPE (Editor, " CCryEditDoc::SaveLevel Save Entities To Stream" );
1222
- AzToolsFramework::EditorEntityContextRequestBus::BroadcastResult (
1223
- savedEntities,
1224
- &AzToolsFramework::EditorEntityContextRequestBus::Events::SaveToStreamForEditor,
1225
- entitySaveStream,
1226
- layerEntities,
1227
- instancesInLayers);
1228
- }
1229
-
1230
- for (AZ::Entity* entity : editorEntities)
1231
- {
1232
- AzToolsFramework::Layers::EditorLayerComponentRequestBus::Event (
1233
- entity->GetId (), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::RestoreEditorData);
1234
- }
1235
-
1236
1168
if (savedEntities)
1237
1169
{
1238
1170
AZ_PROFILE_SCOPE (AzToolsFramework, " CCryEditDoc::SaveLevel Updated PakFile levelEntities.editor_xml" );
0 commit comments