diff --git a/renderdocui/Code/PersistantConfig.cs b/renderdocui/Code/PersistantConfig.cs index 2a4dd5254..1539f148b 100644 --- a/renderdocui/Code/PersistantConfig.cs +++ b/renderdocui/Code/PersistantConfig.cs @@ -41,6 +41,7 @@ namespace renderdocui.Code public string LastLogPath = ""; public List RecentLogFiles = new List(); public string LastCapturePath = ""; + public string LastCaptureExe = ""; public List RecentCaptureSettings = new List(); public int CallstackLevelSkip = 0; diff --git a/renderdocui/Windows/Dialogs/CaptureDialog.cs b/renderdocui/Windows/Dialogs/CaptureDialog.cs index 3af0a5c56..332dd8369 100644 --- a/renderdocui/Windows/Dialogs/CaptureDialog.cs +++ b/renderdocui/Windows/Dialogs/CaptureDialog.cs @@ -326,9 +326,21 @@ namespace renderdocui.Windows.Dialogs try { if (exePath.Text.Length > 0 && Directory.Exists(Path.GetDirectoryName(exePath.Text))) + { exeBrowser.InitialDirectory = Path.GetDirectoryName(exePath.Text); + } else if (m_Core.Config.LastCapturePath.Length > 0) - exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; + { + if (m_Core.Config.LastCaptureExe.Length > 0) + { + exeBrowser.FileName = m_Core.Config.LastCaptureExe; + exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; + } + else + { + exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; + } + } } catch (ArgumentException) { @@ -345,6 +357,7 @@ namespace renderdocui.Windows.Dialogs UpdateWorkDirHint(); m_Core.Config.LastCapturePath = Path.GetDirectoryName(exeBrowser.FileName); + m_Core.Config.LastCaptureExe = Path.GetFileName(exeBrowser.FileName); } private void exePath_DragEnter(object sender, DragEventArgs e) @@ -365,6 +378,7 @@ namespace renderdocui.Windows.Dialogs UpdateWorkDirHint(); m_Core.Config.LastCapturePath = Path.GetDirectoryName(exeBrowser.FileName); + m_Core.Config.LastCaptureExe = Path.GetFileName(exeBrowser.FileName); } }