Ver Fonte

Enable NativeUI if ASV standalone is not in test mode. (#368)

Signed-off-by: Qing Tao <[email protected]>
Qing Tao há 3 anos atrás
pai
commit
f1d64c3d35

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

@@ -103,6 +103,16 @@ namespace AtomSampleViewer
     void AtomSampleViewerApplication::OnSampleManagerActivated()
     {
         ReadAutomatedTestOptions();
+
+        // enable native UI for some error messages if it's not test mode
+        if (!m_isTestMode)
+        {
+            if (auto nativeUI = AZ::Interface<AZ::NativeUI::NativeUIRequests>::Get(); nativeUI != nullptr)
+            {
+                nativeUI->SetMode(AZ::NativeUI::Mode::ENABLED);
+            }
+        }
+
     }
 
     void AtomSampleViewerApplication::WriteStartupLog()
@@ -164,6 +174,8 @@ namespace AtomSampleViewer
                 }
 
                 SampleComponentManagerRequestBus::Broadcast(&SampleComponentManagerRequestBus::Events::RunMainTestSuite, testSuitePath, exitOnTestEnd, randomSeed);
+
+                m_isTestMode = true;
             }
         }
     }

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

@@ -87,6 +87,8 @@ namespace AtomSampleViewer
         int m_exitCode = 0;
 
         void SetupConsoleHandlerRoutine();
+
+        bool m_isTestMode = false;
     };
 
     int RunGameCommon(int argc, char** argv, AZStd::function<void()> customRunCode = nullptr);