diff --git a/SuperScreenShotterVR/MainController.cs b/SuperScreenShotterVR/MainController.cs index ba47e54..f152093 100644 --- a/SuperScreenShotterVR/MainController.cs +++ b/SuperScreenShotterVR/MainController.cs @@ -30,6 +30,7 @@ public class MainController private bool _initComplete = false; private bool _isHookedForScreenshots = false; private string _currentAppId = ""; + private string _currentAppName = ""; private ulong _notificationOverlayHandle = 0; private Dictionary _screenshotQueue = new Dictionary(); private uint _lastScreenshotHandle = 0; @@ -149,6 +150,7 @@ private void WorkerThread() UpdateScreenshotHook(); PlayScreenshotSound(true); _currentAppId = _ovr.GetRunningApplicationId(); + _currentAppName = _ovr.GetApplicationPropertyString(_currentAppId, EVRApplicationProperty.Name_String); AppUpdateAction.Invoke(_currentAppId); // ToggleViewfinder(true); // DEBUG UpdateTrackedDeviceIndex(); @@ -185,6 +187,7 @@ private void WorkerThread() _notificationOverlayHandle = _ovr.InitNotificationOverlay("SuperScreenShotterVR"); _currentAppId = _ovr.GetRunningApplicationId(); + _currentAppName = _ovr.GetApplicationPropertyString(_currentAppId, EVRApplicationProperty.Name_String); // Events _ovr.RegisterEvent(EVREventType.VREvent_RequestScreenshot, (data) => { @@ -432,13 +435,22 @@ public void UpdateOutputFolder(bool createDirIfNeeded = false, string subfolder { var dir = _settings.Directory; if (createDirIfNeeded && !Directory.Exists(dir)) Directory.CreateDirectory(dir); - if(_currentAppId != string.Empty) + + if (_settings.OutputAppname && _currentAppName != string.Empty) + { + Debug.WriteLine($"Settings subfolder to: steam.app.{_currentAppName}"); + dir = $"{dir}\\steam.app.{_currentAppName}"; + if (subfolder != string.Empty) dir = $"{dir}\\{subfolder}"; + if (createDirIfNeeded && !Directory.Exists(dir)) Directory.CreateDirectory(dir); + } + else if (_currentAppId != string.Empty) { Debug.WriteLine($"Settings subfolder to: {_currentAppId}"); dir = $"{dir}\\{_currentAppId}"; if (subfolder != string.Empty) dir = $"{dir}\\{subfolder}"; if (createDirIfNeeded && !Directory.Exists(dir)) Directory.CreateDirectory(dir); - } else + } + else { if (subfolder != string.Empty) dir = $"{dir}\\{subfolder}"; } diff --git a/SuperScreenShotterVR/MainWindow.xaml b/SuperScreenShotterVR/MainWindow.xaml index b9f6bde..b194d32 100644 --- a/SuperScreenShotterVR/MainWindow.xaml +++ b/SuperScreenShotterVR/MainWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SuperScreenShotterVR" mc:Ignorable="d" - Title="SuperScreenShotterVR" Height="500" Width="840" Icon="resources/logo.ico" StateChanged="Window_StateChanged"> + Title="SuperScreenShotterVR" Height="520" Width="840" Icon="resources/logo.ico" StateChanged="Window_StateChanged"> @@ -83,6 +83,7 @@ +