LYN-2723: Fixes issues with bad project or engine paths (#369)
* Setup NativeUIRequests as an AZ::Interface. Adds a NativeUISystemComponent to AzFramework Application. * Renames NativeUISystemComponent (class) to NativeUISystem, since it's no longer a Component. * Minor update to SettingsRegistryInterface::Remove doc-comments for accuracy. * Fixes to make an early fatal shutdown of Editor occur without crash. * LYN-2723: Updates startup to handle errors: engine root is empty, no valid project.json found (mismatched engine name), or bad project path (launch project picker dialog). * LYN-2723: Minor formatting/spelling edits. * LYN-2723: Moves ParseCommandLine from ComponentApplication to SettingsRegistryMergeUtils so it can be used in more places. * Misc fixes. 'wait_for_connect' setting wasn't being properly applied to AP connection settings. Fix infinite loop in CCmdLine::Next. * LYN-2723: Addresses review feedback. * LYN-2723: Reverts some changes that caused a unit test to fail. * LYN-2723: Reverts one more change that was unnecessary.
This commit is contained in:
@@ -175,7 +175,7 @@ namespace AzFramework
|
||||
}
|
||||
|
||||
// Initializes the IArchive for reading archive(.pak) files
|
||||
if (auto archive = AZ::Interface<AZ::IO::IArchive>::Get(); !archive)
|
||||
if (auto archive = AZ::Interface<AZ::IO::IArchive>::Get(); archive == nullptr)
|
||||
{
|
||||
m_archive = AZStd::make_unique<AZ::IO::Archive>();
|
||||
AZ::Interface<AZ::IO::IArchive>::Register(m_archive.get());
|
||||
@@ -189,6 +189,12 @@ namespace AzFramework
|
||||
SetFileIOAliases();
|
||||
}
|
||||
|
||||
if (auto nativeUI = AZ::Interface<AZ::NativeUI::NativeUIRequests>::Get(); nativeUI == nullptr)
|
||||
{
|
||||
m_nativeUI = AZStd::make_unique<AZ::NativeUI::NativeUISystem>();
|
||||
AZ::Interface<AZ::NativeUI::NativeUIRequests>::Register(m_nativeUI.get());
|
||||
}
|
||||
|
||||
ApplicationRequests::Bus::Handler::BusConnect();
|
||||
AZ::UserSettingsFileLocatorBus::Handler::BusConnect();
|
||||
NetSystemRequestBus::Handler::BusConnect();
|
||||
@@ -205,12 +211,17 @@ namespace AzFramework
|
||||
AZ::UserSettingsFileLocatorBus::Handler::BusDisconnect();
|
||||
ApplicationRequests::Bus::Handler::BusDisconnect();
|
||||
|
||||
if (AZ::Interface<AZ::NativeUI::NativeUIRequests>::Get() == m_nativeUI.get())
|
||||
{
|
||||
AZ::Interface<AZ::NativeUI::NativeUIRequests>::Unregister(m_nativeUI.get());
|
||||
}
|
||||
m_nativeUI.reset();
|
||||
|
||||
// Unset the Archive file IO if it is set as the direct instance
|
||||
if (AZ::IO::FileIOBase::GetInstance() == m_archiveFileIO.get())
|
||||
{
|
||||
AZ::IO::FileIOBase::SetInstance(nullptr);
|
||||
}
|
||||
|
||||
m_archiveFileIO.reset();
|
||||
|
||||
// Destroy the IArchive instance
|
||||
@@ -303,7 +314,6 @@ namespace AzFramework
|
||||
azrtti_typeid<AZ::AssetManagerComponent>(),
|
||||
azrtti_typeid<AZ::UserSettingsComponent>(),
|
||||
azrtti_typeid<AZ::Debug::FrameProfilerComponent>(),
|
||||
azrtti_typeid<AZ::NativeUI::NativeUISystemComponent>(),
|
||||
azrtti_typeid<AZ::SliceComponent>(),
|
||||
azrtti_typeid<AZ::SliceSystemComponent>(),
|
||||
|
||||
@@ -372,7 +382,6 @@ namespace AzFramework
|
||||
azrtti_typeid<AZ::UserSettingsComponent>(),
|
||||
azrtti_typeid<AZ::ScriptSystemComponent>(),
|
||||
azrtti_typeid<AZ::JobManagerComponent>(),
|
||||
azrtti_typeid<AZ::NativeUI::NativeUISystemComponent>(),
|
||||
azrtti_typeid<AZ::SliceSystemComponent>(),
|
||||
|
||||
azrtti_typeid<AzFramework::AssetCatalogComponent>(),
|
||||
|
||||
Reference in New Issue
Block a user