Deprecate IsPrefabSystemForLevelsEnabled and use IsPrefabSystemEnabled everywhere (#7327)

Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>
monroegm-disable-blank-issue-2
srikappa-amzn 4 years ago committed by GitHub
parent 31f39930af
commit fd20b028a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -588,7 +588,7 @@ QMenu* LevelEditorMenuHandler::CreateGameMenu()
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (!usePrefabSystemForLevels) if (!usePrefabSystemForLevels)
{ {
// Export to Engine // Export to Engine

@ -706,7 +706,7 @@ void CCryEditApp::OnFileSave()
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (!usePrefabSystemForLevels) if (!usePrefabSystemForLevels)
{ {
@ -2364,7 +2364,7 @@ void CCryEditApp::ExportLevel(bool bExportToGame, bool bExportTexture, bool bAut
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {
AZ_Assert(false, "Prefab system doesn't require level exports."); AZ_Assert(false, "Prefab system doesn't require level exports.");
@ -2405,7 +2405,7 @@ bool CCryEditApp::UserExportToGame(bool bNoMsgBox)
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {
AZ_Assert(false, "Export Level should no longer exist."); AZ_Assert(false, "Export Level should no longer exist.");
@ -2453,7 +2453,7 @@ void CCryEditApp::ExportToGame(bool bNoMsgBox)
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {
AZ_Assert(false, "Prefab system no longer exports levels."); AZ_Assert(false, "Prefab system no longer exports levels.");
@ -2961,7 +2961,7 @@ CCryEditApp::ECreateLevelResult CCryEditApp::CreateLevel(const QString& levelNam
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
// If we are creating a new level and we're in simulate mode, then switch it off before we do anything else // If we are creating a new level and we're in simulate mode, then switch it off before we do anything else
if (GetIEditor()->GetGameEngine() && GetIEditor()->GetGameEngine()->GetSimulationMode()) if (GetIEditor()->GetGameEngine() && GetIEditor()->GetGameEngine()->GetSimulationMode())
@ -3107,7 +3107,7 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled)
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (!usePrefabSystemForLevels) if (!usePrefabSystemForLevels)
{ {
QString str = QObject::tr("Level %1 has been changed. Save Level?").arg(GetIEditor()->GetGameEngine()->GetLevelName()); QString str = QObject::tr("Level %1 has been changed. Save Level?").arg(GetIEditor()->GetGameEngine()->GetLevelName());
@ -3321,7 +3321,7 @@ CCryEditDoc* CCryEditApp::OpenDocumentFile(const char* filename, bool addToMostR
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
// If we are loading and we're in simulate mode, then switch it off before we do anything else // If we are loading and we're in simulate mode, then switch it off before we do anything else
if (GetIEditor()->GetGameEngine() && GetIEditor()->GetGameEngine()->GetSimulationMode()) if (GetIEditor()->GetGameEngine() && GetIEditor()->GetGameEngine()->GetSimulationMode())

@ -371,7 +371,7 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (!usePrefabSystemForLevels) if (!usePrefabSystemForLevels)
{ {
@ -636,7 +636,7 @@ bool CCryEditDoc::SaveModified()
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (!usePrefabSystemForLevels) if (!usePrefabSystemForLevels)
{ {
QMessageBox saveModifiedMessageBox(AzToolsFramework::GetActiveWindow()); QMessageBox saveModifiedMessageBox(AzToolsFramework::GetActiveWindow());
@ -699,7 +699,7 @@ void CCryEditDoc::OnFileSaveAs()
CCryEditApp::instance()->AddToRecentFileList(levelFileDialog.GetFileName()); CCryEditApp::instance()->AddToRecentFileList(levelFileDialog.GetFileName());
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId =
@ -728,7 +728,7 @@ bool CCryEditDoc::BeforeOpenDocument(const QString& lpszPathName, TOpenDocContex
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (!usePrefabSystemForLevels) if (!usePrefabSystemForLevels)
{ {

@ -489,7 +489,7 @@ bool CGameEngine::LoadLevel(
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (!usePrefabSystemForLevels) if (!usePrefabSystemForLevels)
{ {

@ -100,7 +100,7 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {

@ -70,7 +70,7 @@ private:
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {
AZ_Assert(false, "Level.pak should no longer be used when prefabs are used for levels."); AZ_Assert(false, "Level.pak should no longer be used when prefabs are used for levels.");

@ -659,7 +659,7 @@ void MainWindow::InitActions()
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (!usePrefabSystemForLevels) if (!usePrefabSystemForLevels)
{ {
am->AddAction(ID_FILE_EXPORTTOGAMENOSURFACETEXTURE, tr("&Export to Engine")) am->AddAction(ID_FILE_EXPORTTOGAMENOSURFACETEXTURE, tr("&Export to Engine"))

@ -112,6 +112,7 @@ namespace AzFramework
virtual void SetPrefabSystemEnabled([[maybe_unused]] bool enable) {} virtual void SetPrefabSystemEnabled([[maybe_unused]] bool enable) {}
/// Returns true if Prefab System is enabled for use with levels, false if legacy level system is enabled (level.pak) /// Returns true if Prefab System is enabled for use with levels, false if legacy level system is enabled (level.pak)
/// @deprecated Use 'IsPrefabSystemEnabled' instead
virtual bool IsPrefabSystemForLevelsEnabled() const { return false; } virtual bool IsPrefabSystemForLevelsEnabled() const { return false; }
/// Returns true if code should assert when the Legacy Slice System is used /// Returns true if code should assert when the Legacy Slice System is used

@ -765,6 +765,7 @@ namespace AzFramework
bool Application::IsPrefabSystemForLevelsEnabled() const bool Application::IsPrefabSystemForLevelsEnabled() const
{ {
AZ_Warning("Application", false, "'IsPrefabSystemForLevelsEnabled' is deprecated, please use 'IsPrefabSystemEnabled' instead.");
return IsPrefabSystemEnabled(); return IsPrefabSystemEnabled();
} }

@ -1208,7 +1208,7 @@ namespace AZ::IO
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {
@ -1274,7 +1274,7 @@ namespace AZ::IO
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
AZStd::unique_lock lock(m_csZips); AZStd::unique_lock lock(m_csZips);
for (auto it = m_arrZips.begin(); it != m_arrZips.end();) for (auto it = m_arrZips.begin(); it != m_arrZips.end();)

@ -295,7 +295,7 @@ namespace AzToolsFramework
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
for (const AzToolsFramework::AssetFileInfo& assetFileInfo : assetFileInfoList.m_fileInfoList) for (const AzToolsFramework::AssetFileInfo& assetFileInfo : assetFileInfoList.m_fileInfoList)
{ {

@ -41,7 +41,7 @@ bool CLevelInfo::OpenLevelPak()
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
// The prefab system doesn't use level.pak // The prefab system doesn't use level.pak
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
@ -62,7 +62,7 @@ void CLevelInfo::CloseLevelPak()
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
// The prefab system doesn't use level.pak // The prefab system doesn't use level.pak
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
@ -82,7 +82,7 @@ bool CLevelInfo::ReadInfo()
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
// Set up a default game type for legacy code. // Set up a default game type for legacy code.
m_defaultGameTypeName = "mission0"; m_defaultGameTypeName = "mission0";

@ -1046,7 +1046,7 @@ AZ_POP_DISABLE_WARNING
// LEVEL SYSTEM // LEVEL SYSTEM
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {

@ -277,7 +277,7 @@ namespace GameStateSamples
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {

@ -267,7 +267,7 @@ namespace ImGui
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)
{ {

@ -17,7 +17,7 @@ namespace LevelBuilder
{ {
bool usePrefabSystemForLevels = false; bool usePrefabSystemForLevels = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult( AzFramework::ApplicationRequests::Bus::BroadcastResult(
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
// No need to build level.pak files when using the prefab system. // No need to build level.pak files when using the prefab system.
if (usePrefabSystemForLevels) if (usePrefabSystemForLevels)

Loading…
Cancel
Save