From 86c0d72aa106e215930c6c1e1352948aa2f5f0f9 Mon Sep 17 00:00:00 2001 From: Raicuparta Date: Mon, 9 Oct 2023 09:02:12 +0200 Subject: [PATCH 1/2] Shutdown if attached game closes --- UnrealVR/MainWindow.xaml.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UnrealVR/MainWindow.xaml.cs b/UnrealVR/MainWindow.xaml.cs index 3de2f65..a1a804b 100644 --- a/UnrealVR/MainWindow.xaml.cs +++ b/UnrealVR/MainWindow.xaml.cs @@ -360,6 +360,13 @@ private void Update_InjectorConnectionStatus() { lastFrontendSignal = now; } } else { + if (m_connected && m_commandLineAttachExe.Length != 0) + { + // If we launched with an attached game exe, we shut ourselves down once that game closes. + Application.Current.Shutdown(); + return; + } + m_connectionStatus.Text = UnrealVRConnectionStatus.NoInstanceDetected; m_connected = false; Hide_ConnectionOptions(); From a999bf9e423a52478ac04cec6f51690a8684913b Mon Sep 17 00:00:00 2001 From: Raicuparta Date: Mon, 9 Oct 2023 15:21:55 +0200 Subject: [PATCH 2/2] Check if attach argument is null too --- UnrealVR/MainWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnrealVR/MainWindow.xaml.cs b/UnrealVR/MainWindow.xaml.cs index a1a804b..738089e 100644 --- a/UnrealVR/MainWindow.xaml.cs +++ b/UnrealVR/MainWindow.xaml.cs @@ -360,7 +360,7 @@ private void Update_InjectorConnectionStatus() { lastFrontendSignal = now; } } else { - if (m_connected && m_commandLineAttachExe.Length != 0) + if (m_connected && !string.IsNullOrEmpty(m_commandLineAttachExe)) { // If we launched with an attached game exe, we shut ourselves down once that game closes. Application.Current.Shutdown();