瀏覽代碼

Fix Standalone viewer

Signed-off-by: Akio Gaule <[email protected]>
Akio Gaule 1 年之前
父節點
當前提交
16c26592de

+ 19 - 0
Standalone/Platform/Common/AtomSampleViewerApplication.cpp

@@ -17,6 +17,8 @@
 
 #include <AzFramework/Asset/AssetSystemBus.h>
 #include <AzFramework/Asset/AssetProcessorMessages.h>
+#include <AzFramework/AzFrameworkNativeUIModule.h>
+#include <AzFramework/Components/NativeUISystemComponent.h>
 #include <AzFramework/IO/LocalFileIO.h>
 #include <AzFramework/Network/AssetProcessorConnection.h>
 #include <AzFramework/StringFunc/StringFunc.h>
@@ -114,6 +116,12 @@ namespace AtomSampleViewer
 
     }
 
+    void AtomSampleViewerApplication::CreateStaticModules(AZStd::vector<AZ::Module*>& outModules)
+    {
+        AzFramework::Application::CreateStaticModules(outModules);
+        outModules.push_back(aznew AzFramework::AzFrameworkNativeUIModule());
+    }
+
     void AtomSampleViewerApplication::WriteStartupLog()
     {
         AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
@@ -206,6 +214,17 @@ namespace AtomSampleViewer
         Application::Destroy();
     }
 
+    AZ::ComponentTypeList AtomSampleViewerApplication::GetRequiredSystemComponents() const
+    {
+        AZ::ComponentTypeList components = AzFramework::Application::GetRequiredSystemComponents();
+        components.insert(
+            components.end(),
+            {
+                azrtti_typeid<AzFramework::NativeUISystemComponent>(),
+            });
+        return components;
+    }
+
     void AtomSampleViewerApplication::Tick()
     {
         TickSystem();

+ 8 - 0
Standalone/Platform/Common/AtomSampleViewerApplication.h

@@ -37,6 +37,11 @@ namespace AtomSampleViewer
 
         int GetExitCode() const { return m_exitCode; }
 
+        //////////////////////////////////////////////////////////////////////////
+        // AZ::ComponentApplication
+        AZ::ComponentTypeList GetRequiredSystemComponents() const override;
+        //////////////////////////////////////////////////////////////////////////
+
     private:
         //////////////////////////////////////////////////////////////////////////
         // AzFramework::AssetSystemStatusBus::Handler
@@ -72,6 +77,9 @@ namespace AtomSampleViewer
         // SampleComponentManagerNotificationBus ...
         void OnSampleManagerActivated() override;
 
+        // AzFramework::Application ...
+        void CreateStaticModules(AZStd::vector<AZ::Module*>& outModules) override;
+
         void WriteStartupLog();
         void ReadAutomatedTestOptions();