Skip to content

Commit 38cff4d

Browse files
committed
Merge branch 'development' of https://github.com/o3de/o3de into daimini/Prefabs/FixDuplicateSelection
Signed-off-by: Danilo Aimini <[email protected]>
2 parents 31b6de2 + f1b110f commit 38cff4d

File tree

23 files changed

+676
-160
lines changed

23 files changed

+676
-160
lines changed

Code/Editor/EditorPreferencesPageFiles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void CEditorPreferencesPage_Files::Reflect(AZ::SerializeContext& serialize)
6666
->Attribute(AZ::Edit::Attributes::Min, 1)
6767
->Attribute(AZ::Edit::Attributes::Max, 100)
6868
->DataElement(AZ::Edit::UIHandlers::LineEdit, &Files::m_standardTempDirectory, "Standard Temporary Directory", "Standard Temporary Directory")
69-
->DataElement(AZ::Edit::UIHandlers::LineEdit, &Files::m_saveLocation, "Slice Save location", "Specify the default location to save new slices");
69+
->DataElement(AZ::Edit::UIHandlers::LineEdit, &Files::m_saveLocation, "UI Slice Save location", "Specify the default location to save new UI slices");
7070

7171
editContext->Class<ExternalEditors>("External Editors", "External Editors")
7272
->DataElement(AZ::Edit::UIHandlers::ExeSelectBrowseEdit, &ExternalEditors::m_scripts, "Scripts Editor", "Scripts Text Editor")

Code/Editor/EditorPreferencesPageGeneral.cpp

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,18 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
4747

4848
serialize.Class<Messaging>()
4949
->Version(2)
50-
->Field("ShowDashboard", &Messaging::m_showDashboard)
51-
->Field("ShowCircularDependencyError", &Messaging::m_showCircularDependencyError);
50+
->Field("ShowDashboard", &Messaging::m_showDashboard);
5251

5352
serialize.Class<Undo>()
5453
->Version(2)
55-
->Field("UndoLevels", &Undo::m_undoLevels)
56-
->Field("UndoSliceOverrideSaves", &Undo::m_undoSliceOverrideSaveValue);
57-
58-
serialize.Class<SliceSettings>()
59-
->Version(1)
60-
->Field("DynamicByDefault", &SliceSettings::m_slicesDynamicByDefault);
54+
->Field("UndoLevels", &Undo::m_undoLevels);
6155

6256
serialize.Class<CEditorPreferencesPage_General>()
6357
->Version(1)
6458
->Field("General Settings", &CEditorPreferencesPage_General::m_generalSettings)
6559
->Field("Prefab Save Settings", &CEditorPreferencesPage_General::m_levelSaveSettings)
6660
->Field("Messaging", &CEditorPreferencesPage_General::m_messaging)
67-
->Field("Undo", &CEditorPreferencesPage_General::m_undo)
68-
->Field("Slice Settings", &CEditorPreferencesPage_General::m_sliceSettings);
69-
70-
61+
->Field("Undo", &CEditorPreferencesPage_General::m_undo);
7162

7263
AZ::EditContext* editContext = serialize.GetEditContext();
7364
if (editContext)
@@ -98,26 +89,20 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
9889
->EnumAttribute(AzToolsFramework::Prefab::SaveAllPrefabsPreference::SaveNone, "Save none");
9990

10091
editContext->Class<Messaging>("Messaging", "")
101-
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Messaging::m_showDashboard, "Show Welcome to Open 3D Engine at startup", "Show Welcome to Open 3D Engine at startup")
102-
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Messaging::m_showCircularDependencyError, "Show Error: Circular dependency", "Show an error message when adding a slice instance to the target slice would create a cyclic asset dependency. All other valid overrides will be saved even if this is turned off.");
92+
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Messaging::m_showDashboard, "Show Welcome to Open 3D Engine at startup", "Show Welcome to Open 3D Engine at startup");
10393

10494
editContext->Class<Undo>("Undo", "")
10595
->DataElement(AZ::Edit::UIHandlers::SpinBox, &Undo::m_undoLevels, "Undo Levels", "This field specifies the number of undo levels")
10696
->Attribute(AZ::Edit::Attributes::Min, 0)
107-
->Attribute(AZ::Edit::Attributes::Max, 10000)
108-
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Undo::m_undoSliceOverrideSaveValue, "Undo Slice Override Saves", "Allow slice saves to be undone");
109-
110-
editContext->Class<SliceSettings>("Slices", "")
111-
->DataElement(AZ::Edit::UIHandlers::CheckBox, &SliceSettings::m_slicesDynamicByDefault, "New Slices Dynamic By Default", "When creating slices, they will be set to dynamic by default");
97+
->Attribute(AZ::Edit::Attributes::Max, 10000);
11298

11399
editContext->Class<CEditorPreferencesPage_General>("General Editor Preferences", "Class for handling General Editor Preferences")
114100
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
115101
->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20))
116102
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_generalSettings, "General Settings", "General Editor Preferences")
117103
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_levelSaveSettings, "Prefab Save Settings", "File>Save")
118104
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_messaging, "Messaging", "Messaging")
119-
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_undo, "Undo", "Undo Preferences")
120-
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_sliceSettings, "Slices", "Slice Settings");
105+
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_undo, "Undo", "Undo Preferences");
121106
}
122107
}
123108

@@ -147,7 +132,6 @@ void CEditorPreferencesPage_General::OnApply()
147132
gSettings.consoleBackgroundColorTheme = m_generalSettings.m_consoleBackgroundColorTheme;
148133
gSettings.bShowTimeInConsole = m_generalSettings.m_bShowTimeInConsole;
149134
gSettings.bShowDashboardAtStartup = m_messaging.m_showDashboard;
150-
gSettings.m_showCircularDependencyError = m_messaging.m_showCircularDependencyError;
151135
gSettings.bAutoloadLastLevelAtStartup = m_generalSettings.m_autoLoadLastLevel;
152136
gSettings.stylusMode = m_generalSettings.m_stylusMode;
153137
gSettings.restoreViewportCamera = m_generalSettings.m_restoreViewportCamera;
@@ -164,11 +148,6 @@ void CEditorPreferencesPage_General::OnApply()
164148

165149
//undo
166150
gSettings.undoLevels = m_undo.m_undoLevels;
167-
168-
gSettings.m_undoSliceOverrideSaveValue = m_undo.m_undoSliceOverrideSaveValue;
169-
170-
//slices
171-
gSettings.sliceSettings.dynamicByDefault = m_sliceSettings.m_slicesDynamicByDefault;
172151
}
173152

174153
void CEditorPreferencesPage_General::InitializeSettings()
@@ -191,12 +170,8 @@ void CEditorPreferencesPage_General::InitializeSettings()
191170

192171
//Messaging
193172
m_messaging.m_showDashboard = gSettings.bShowDashboardAtStartup;
194-
m_messaging.m_showCircularDependencyError = gSettings.m_showCircularDependencyError;
195173

196174
//undo
197175
m_undo.m_undoLevels = gSettings.undoLevels;
198-
m_undo.m_undoSliceOverrideSaveValue = gSettings.m_undoSliceOverrideSaveValue;
199176

200-
//slices
201-
m_sliceSettings.m_slicesDynamicByDefault = gSettings.sliceSettings.dynamicByDefault;
202177
}

Code/Editor/EditorPreferencesPageGeneral.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,19 @@ class CEditorPreferencesPage_General
7272
AZ_TYPE_INFO(Messaging, "{A6AD87CB-E905-409B-A2BF-C43CDCE63B0C}")
7373

7474
bool m_showDashboard;
75-
bool m_showCircularDependencyError;
7675
};
7776

7877
struct Undo
7978
{
8079
AZ_TYPE_INFO(Undo, "{A3AC0728-F132-4BF2-B122-8A631B636E81}")
8180

8281
int m_undoLevels;
83-
bool m_undoSliceOverrideSaveValue;
84-
};
85-
86-
struct SliceSettings
87-
{
88-
AZ_TYPE_INFO(SliceSettings, "{8505CCC1-874C-4389-B51A-B9E5FF70CFDA}")
89-
90-
bool m_slicesDynamicByDefault;
9182
};
9283

9384
GeneralSettings m_generalSettings;
9485
LevelSaveSettings m_levelSaveSettings;
9586
Messaging m_messaging;
9687
Undo m_undo;
97-
SliceSettings m_sliceSettings;
9888
QIcon m_icon;
9989
};
10090

Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,18 +1297,17 @@ IEditor* SandboxIntegrationManager::GetEditor()
12971297
//////////////////////////////////////////////////////////////////////////
12981298
bool SandboxIntegrationManager::GetUndoSliceOverrideSaveValue()
12991299
{
1300-
return GetIEditor()->GetEditorSettings()->m_undoSliceOverrideSaveValue;
1300+
return false;
13011301
}
13021302

13031303
//////////////////////////////////////////////////////////////////////////
13041304
bool SandboxIntegrationManager::GetShowCircularDependencyError()
13051305
{
1306-
return GetIEditor()->GetEditorSettings()->m_showCircularDependencyError;
1306+
return true;
13071307
}
13081308

1309-
void SandboxIntegrationManager::SetShowCircularDependencyError(const bool& showCircularDependencyError)
1309+
void SandboxIntegrationManager::SetShowCircularDependencyError(const bool& /* showCircularDependencyError */)
13101310
{
1311-
GetIEditor()->GetEditorSettings()->m_showCircularDependencyError = showCircularDependencyError;
13121311
}
13131312

13141313
//////////////////////////////////////////////////////////////////////////

Code/Editor/Settings.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*
77
*/
88

9-
109
#include "EditorDefs.h"
1110

1211
#include "Settings.h"
@@ -24,7 +23,6 @@
2423
#include <AzCore/StringFunc/StringFunc.h>
2524
#include <AzCore/Utils/Utils.h>
2625

27-
2826
// AzFramework
2927
#include <AzFramework/API/ApplicationAPI.h>
3028
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
@@ -36,7 +34,6 @@
3634
#include "CryEdit.h"
3735
#include "MainWindow.h"
3836

39-
4037
//////////////////////////////////////////////////////////////////////////
4138
// Global Instance of Editor settings.
4239
//////////////////////////////////////////////////////////////////////////
@@ -107,9 +104,7 @@ SEditorSettings::SEditorSettings()
107104
bSettingsManagerMode = false;
108105

109106
undoLevels = 50;
110-
m_undoSliceOverrideSaveValue = false;
111107
bShowDashboardAtStartup = true;
112-
m_showCircularDependencyError = true;
113108
bAutoloadLastLevelAtStartup = false;
114109
bMuteAudio = false;
115110

@@ -218,7 +213,6 @@ SEditorSettings::SEditorSettings()
218213
backgroundUpdatePeriod = 0;
219214
g_TemporaryLevelName = nullptr;
220215

221-
sliceSettings.dynamicByDefault = false;
222216
levelSaveSettings.saveAllPrefabsPreference = AzToolsFramework::Prefab::SaveAllPrefabsPreference::AskEveryTime;
223217
}
224218

@@ -423,9 +417,7 @@ void SEditorSettings::Save(bool isEditorClosing)
423417

424418
// Save settings to registry.
425419
SaveValue("Settings", "UndoLevels", undoLevels);
426-
SaveValue("Settings", "UndoSliceOverrideSaveValue", m_undoSliceOverrideSaveValue);
427420
SaveValue("Settings", "ShowWelcomeScreenAtStartup", bShowDashboardAtStartup);
428-
SaveValue("Settings", "ShowCircularDependencyError", m_showCircularDependencyError);
429421
SaveValue("Settings", "LoadLastLevelAtStartup", bAutoloadLastLevelAtStartup);
430422
SaveValue("Settings", "MuteAudio", bMuteAudio);
431423
SaveValue("Settings", "AutoBackup", autoBackupEnabled);
@@ -563,18 +555,10 @@ void SEditorSettings::Save(bool isEditorClosing)
563555
SaveValue("Settings\\SmartFileOpen", "DlgRect.Right", smartOpenSettings.rect.right());
564556
SaveValue("Settings\\SmartFileOpen", "DlgRect.Bottom", smartOpenSettings.rect.bottom());
565557

566-
//////////////////////////////////////////////////////////////////////////
567-
// Slice settings
568-
//////////////////////////////////////////////////////////////////////////
569-
SaveValue("Settings\\Slices", "DynamicByDefault", sliceSettings.dynamicByDefault);
570-
571558
s_editorSettings()->sync();
572559

573560
// --- Settings Registry values
574561

575-
// Prefab System UI
576-
AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::SetPrefabSystemEnabled, prefabSystem);
577-
578562
AzToolsFramework::Prefab::PrefabLoaderInterface* prefabLoaderInterface =
579563
AZ::Interface<AzToolsFramework::Prefab::PrefabLoaderInterface>::Get();
580564
prefabLoaderInterface->SetSaveAllPrefabsPreference(levelSaveSettings.saveAllPrefabsPreference);
@@ -592,12 +576,7 @@ void SEditorSettings::Load()
592576
AZ::Interface<AzToolsFramework::Prefab::PrefabLoaderInterface>::Get();
593577
levelSaveSettings.saveAllPrefabsPreference = prefabLoaderInterface->GetSaveAllPrefabsPreference();
594578

595-
// Load from Settings Registry
596-
AzFramework::ApplicationRequests::Bus::BroadcastResult(
597-
prefabSystem, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
598-
599579
const int settingsVersion = s_editorSettings()->value(QStringLiteral("Settings/EditorSettingsVersion"), 0).toInt();
600-
601580
if (settingsVersion != EditorSettingsVersion)
602581
{
603582
s_editorSettings()->setValue(QStringLiteral("Settings/EditorSettingsVersion"), EditorSettingsVersion);
@@ -608,9 +587,7 @@ void SEditorSettings::Load()
608587
QString strPlaceholderString;
609588
// Load settings from registry.
610589
LoadValue("Settings", "UndoLevels", undoLevels);
611-
LoadValue("Settings", "UndoSliceOverrideSaveValue", m_undoSliceOverrideSaveValue);
612590
LoadValue("Settings", "ShowWelcomeScreenAtStartup", bShowDashboardAtStartup);
613-
LoadValue("Settings", "ShowCircularDependencyError", m_showCircularDependencyError);
614591
LoadValue("Settings", "LoadLastLevelAtStartup", bAutoloadLastLevelAtStartup);
615592
LoadValue("Settings", "MuteAudio", bMuteAudio);
616593
LoadValue("Settings", "AutoBackup", autoBackupEnabled);
@@ -777,11 +754,6 @@ void SEditorSettings::Load()
777754
smartOpenSettings.rect.setBottom(soRcBottom);
778755
}
779756

780-
//////////////////////////////////////////////////////////////////////////
781-
// Slice settings
782-
//////////////////////////////////////////////////////////////////////////
783-
LoadValue("Settings\\Slices", "DynamicByDefault", sliceSettings.dynamicByDefault);
784-
785757
//////////////////////////////////////////////////////////////////////////
786758
// Load paths.
787759
//////////////////////////////////////////////////////////////////////////

Code/Editor/Settings.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,6 @@ struct SExperimentalFeaturesSettings
194194
};
195195

196196
//////////////////////////////////////////////////////////////////////////
197-
struct SSliceSettings
198-
{
199-
bool dynamicByDefault;
200-
};
201-
202197
struct SLevelSaveSettings
203198
{
204199
AzToolsFramework::Prefab::SaveAllPrefabsPreference saveAllPrefabsPreference;
@@ -270,7 +265,7 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
270265
void ConvertPath(const AZStd::string_view sourcePath, AZStd::string& category, AZStd::string& attribute);
271266

272267
// needs to be called after crysystem has been loaded
273-
void LoadDefaultGamePaths();
268+
void LoadDefaultGamePaths();
274269

275270
// need to expose updating of the source control enable/disable flag
276271
// because its state is updateable through the main status bar
@@ -283,9 +278,7 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
283278
// Variables.
284279
//////////////////////////////////////////////////////////////////////////
285280
int undoLevels;
286-
bool m_undoSliceOverrideSaveValue;
287281
bool bShowDashboardAtStartup;
288-
bool m_showCircularDependencyError;
289282
bool bAutoloadLastLevelAtStartup;
290283
bool bMuteAudio;
291284

@@ -412,11 +405,16 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
412405
int backgroundUpdatePeriod;
413406
const char* g_TemporaryLevelName;
414407

415-
SSliceSettings sliceSettings;
416-
417408
SLevelSaveSettings levelSaveSettings;
418409

419-
bool prefabSystem = true; ///< Toggle to enable/disable the Prefab system for level entities.
410+
// Legacy - remove once all references have been removed.
411+
struct SSliceSettings
412+
{
413+
bool dynamicByDefault;
414+
};
415+
416+
SSliceSettings sliceSettings;
417+
bool prefabSystem = true;
420418

421419
private:
422420
void SaveValue(const char* sSection, const char* sKey, int value);

Code/Framework/AzFramework/AzFramework/Application/Application.cpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ namespace AzFramework
8989
namespace ApplicationInternal
9090
{
9191
static constexpr const char s_editorModeFeedbackKey[] = "/Amazon/Preferences/EnableEditorModeFeedback";
92-
static constexpr const char s_prefabSystemKey[] = "/Amazon/Preferences/EnablePrefabSystem";
9392
static constexpr const char s_prefabWipSystemKey[] = "/Amazon/Preferences/EnablePrefabSystemWipFeatures";
9493
static constexpr const char s_legacySlicesAssertKey[] = "/Amazon/Preferences/ShouldAssertForLegacySlicesUsage";
9594
static constexpr const char* DeprecatedFileIOAliasesRoot = "/O3DE/AzCore/FileIO/DeprecatedAliases";
@@ -771,12 +770,8 @@ namespace AzFramework
771770

772771
bool Application::IsPrefabSystemEnabled() const
773772
{
774-
bool value = true;
775-
if (auto* registry = AZ::SettingsRegistry::Get())
776-
{
777-
registry->Get(value, ApplicationInternal::s_prefabSystemKey);
778-
}
779-
return value;
773+
AZ_Warning("Application", false, "'IsPrefabSystemEnabled' is deprecated, the editor only supports prefabs for level editing.");
774+
return true;
780775
}
781776

782777
bool Application::ArePrefabWipFeaturesEnabled() const
@@ -789,18 +784,15 @@ namespace AzFramework
789784
return value;
790785
}
791786

792-
void Application::SetPrefabSystemEnabled(bool enable)
787+
void Application::SetPrefabSystemEnabled(bool /* enable */)
793788
{
794-
if (auto* registry = AZ::SettingsRegistry::Get())
795-
{
796-
registry->Set(ApplicationInternal::s_prefabSystemKey, enable);
797-
}
789+
AZ_Warning("Application", false, "'SetPrefabSystemEnabled' is deprecated, the editor only supports prefabs for level editing.");
798790
}
799791

800792
bool Application::IsPrefabSystemForLevelsEnabled() const
801793
{
802-
AZ_Warning("Application", false, "'IsPrefabSystemForLevelsEnabled' is deprecated, please use 'IsPrefabSystemEnabled' instead.");
803-
return IsPrefabSystemEnabled();
794+
AZ_Warning("Application", false, "'IsPrefabSystemForLevelsEnabled' is deprecated, the editor only supports prefabs for level editing.");
795+
return true;
804796
}
805797

806798
bool Application::ShouldAssertForLegacySlicesUsage() const

0 commit comments

Comments
 (0)