diff --git a/GameRes/FileSystem.cs b/GameRes/FileSystem.cs index 3015c5bb..47ee652e 100644 --- a/GameRes/FileSystem.cs +++ b/GameRes/FileSystem.cs @@ -595,7 +595,10 @@ namespace GameRes m_vfs.Pop(); while (Count < desired_vfs_count) { - m_vfs.ChDir (m_vfs.Top.FindFile (desired[Count-1])); + var entry = m_vfs.Top.FindFile (desired[Count-1]); + if (entry is SubDirEntry) + throw new FileNotFoundException(); + m_vfs.ChDir (entry); } m_vfs.Top.CurrentDirectory = desired.Last(); } diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index decf93b8..daaea963 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -105,7 +105,8 @@ namespace GARbro.GUI } ViewModel = vm; lv_SelectItem (0); - SetStatusText (guiStrings.MsgReady); + if (!vm.IsArchive) + SetStatusText (guiStrings.MsgReady); } void WindowKeyDown (object sender, KeyEventArgs e) @@ -640,6 +641,8 @@ namespace GARbro.GUI m_current_input.Mismatch = true; } + static readonly Regex FullpathRe = new Regex (@"^(?:[a-z]:|[\\/])", RegexOptions.IgnoreCase); + private void acb_OnKeyDown (object sender, KeyEventArgs e) { if (e.Key != Key.Return) @@ -647,6 +650,11 @@ namespace GARbro.GUI string path = (sender as AutoCompleteBox).Text; if (string.IsNullOrEmpty (path)) return; + if (FullpathRe.IsMatch (path)) + { + OpenFile (path); + return; + } try { PushViewModel (GetNewViewModel (path)); @@ -750,7 +758,10 @@ namespace GARbro.GUI return; try { - VFS.FullPath = new string[] { filename, "" }; + if (File.Exists (filename)) + VFS.FullPath = new string[] { filename, "" }; + else + VFS.FullPath = new string[] { filename }; var vm = new DirectoryViewModel (VFS.FullPath, VFS.GetFiles(), VFS.IsVirtual); PushViewModel (vm); if (null != VFS.CurrentArchive)