From 86c0d72aa106e215930c6c1e1352948aa2f5f0f9 Mon Sep 17 00:00:00 2001 From: Raicuparta Date: Mon, 9 Oct 2023 09:02:12 +0200 Subject: [PATCH] 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();