Added function comments and nullptr checks
Signed-off-by: srikappa-amzn <srikappa@amazon.com>
This commit is contained in:
+16
-12
@@ -723,24 +723,22 @@ void CCryEditApp::OnFileSave()
|
||||
}
|
||||
|
||||
const QScopedValueRollback<bool> rollback(m_savingLevel, true);
|
||||
|
||||
|
||||
|
||||
bool usePrefabSystemForLevels = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled);
|
||||
|
||||
|
||||
|
||||
if (!usePrefabSystemForLevels)
|
||||
{
|
||||
GetIEditor()->GetDocument()->DoFileSave();
|
||||
}
|
||||
else
|
||||
{
|
||||
auto prefabEditorEntityOwnershipService = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = prefabEditorEntityOwnershipService->GetRootPrefabTemplateId();
|
||||
auto prefabIntegrationInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabIntegrationInterface>::Get();
|
||||
auto* prefabEditorEntityOwnershipInterface = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
auto* prefabIntegrationInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabIntegrationInterface>::Get();
|
||||
AZ_Assert(prefabEditorEntityOwnershipInterface != nullptr, "PrefabEditorEntityOwnershipInterface is not found.");
|
||||
AZ_Assert(prefabIntegrationInterface != nullptr, "PrefabIntegrationInterface is not found.");
|
||||
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = prefabEditorEntityOwnershipInterface->GetRootPrefabTemplateId();
|
||||
prefabIntegrationInterface->ExecuteSavePrefabDialog(rootPrefabTemplateId, true);
|
||||
}
|
||||
}
|
||||
@@ -3187,12 +3185,18 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled)
|
||||
}
|
||||
else
|
||||
{
|
||||
auto prefabEditorEntityOwnershipInterface = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
auto prefabIntegrationInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabIntegrationInterface>::Get();
|
||||
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = prefabEditorEntityOwnershipInterface->GetRootPrefabTemplateId();
|
||||
auto* prefabEditorEntityOwnershipInterface = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
auto* prefabIntegrationInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabIntegrationInterface>::Get();
|
||||
AZ_Assert(prefabEditorEntityOwnershipInterface != nullptr, "PrefabEditorEntityOwnershipInterface is not found.");
|
||||
AZ_Assert(prefabIntegrationInterface != nullptr, "PrefabIntegrationInterface is not found.");
|
||||
|
||||
int prefabSaveSelection =
|
||||
prefabIntegrationInterface->ExecuteClosePrefabDialog(rootPrefabTemplateId);
|
||||
if (prefabEditorEntityOwnershipInterface == nullptr || prefabIntegrationInterface == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = prefabEditorEntityOwnershipInterface->GetRootPrefabTemplateId();
|
||||
int prefabSaveSelection = prefabIntegrationInterface->ExecuteClosePrefabDialog(rootPrefabTemplateId);
|
||||
|
||||
// In order to get the accept and reject codes of QDialog and QDialogButtonBox aligned, we do (1-prefabSaveSelection) here.
|
||||
switch (1 - prefabSaveSelection)
|
||||
|
||||
@@ -245,7 +245,8 @@ QTableWidget#recentLevelTable::item {
|
||||
qproperty-iconSize: 16px 16px;
|
||||
}
|
||||
|
||||
#SavePrefabDialog, #SaveAllFilesDialog
|
||||
|
||||
#ClosePrefabDialog, #SavePrefabDialog
|
||||
{
|
||||
min-width : 640px;
|
||||
}
|
||||
@@ -262,7 +263,7 @@ QTableWidget#recentLevelTable::item {
|
||||
padding: 5px 2px 5px 2px;
|
||||
}
|
||||
|
||||
#SavePrefabDialog #PrefabSaveWarningFrame
|
||||
#ClosePrefabDialog #PrefabSaveWarningFrame
|
||||
{
|
||||
border: 1px solid orange;
|
||||
margin: 10px 15px 10px 15px;
|
||||
@@ -271,12 +272,12 @@ QTableWidget#recentLevelTable::item {
|
||||
color : white;
|
||||
}
|
||||
|
||||
#SaveAllFilesDialog #FooterSeparatorLine, #SavePrefabDialog #FooterSeparatorLine
|
||||
#SavePrefabDialog #FooterSeparatorLine
|
||||
{
|
||||
color: gray;
|
||||
}
|
||||
|
||||
#SaveAllFilesDialog #PrefabSavePreferenceHint, #SavePrefabDialog #PrefabSavePreferenceHint
|
||||
#SavePrefabDialog #PrefabSavePreferenceHint
|
||||
{
|
||||
font: italic;
|
||||
color: #999999;
|
||||
|
||||
Reference in New Issue
Block a user