mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
fixed file system navigation.
This commit is contained in:
@@ -595,7 +595,10 @@ namespace GameRes
|
|||||||
m_vfs.Pop();
|
m_vfs.Pop();
|
||||||
while (Count < desired_vfs_count)
|
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();
|
m_vfs.Top.CurrentDirectory = desired.Last();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,8 @@ namespace GARbro.GUI
|
|||||||
}
|
}
|
||||||
ViewModel = vm;
|
ViewModel = vm;
|
||||||
lv_SelectItem (0);
|
lv_SelectItem (0);
|
||||||
SetStatusText (guiStrings.MsgReady);
|
if (!vm.IsArchive)
|
||||||
|
SetStatusText (guiStrings.MsgReady);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowKeyDown (object sender, KeyEventArgs e)
|
void WindowKeyDown (object sender, KeyEventArgs e)
|
||||||
@@ -640,6 +641,8 @@ namespace GARbro.GUI
|
|||||||
m_current_input.Mismatch = true;
|
m_current_input.Mismatch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static readonly Regex FullpathRe = new Regex (@"^(?:[a-z]:|[\\/])", RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
private void acb_OnKeyDown (object sender, KeyEventArgs e)
|
private void acb_OnKeyDown (object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Key != Key.Return)
|
if (e.Key != Key.Return)
|
||||||
@@ -647,6 +650,11 @@ namespace GARbro.GUI
|
|||||||
string path = (sender as AutoCompleteBox).Text;
|
string path = (sender as AutoCompleteBox).Text;
|
||||||
if (string.IsNullOrEmpty (path))
|
if (string.IsNullOrEmpty (path))
|
||||||
return;
|
return;
|
||||||
|
if (FullpathRe.IsMatch (path))
|
||||||
|
{
|
||||||
|
OpenFile (path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PushViewModel (GetNewViewModel (path));
|
PushViewModel (GetNewViewModel (path));
|
||||||
@@ -750,7 +758,10 @@ namespace GARbro.GUI
|
|||||||
return;
|
return;
|
||||||
try
|
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);
|
var vm = new DirectoryViewModel (VFS.FullPath, VFS.GetFiles(), VFS.IsVirtual);
|
||||||
PushViewModel (vm);
|
PushViewModel (vm);
|
||||||
if (null != VFS.CurrentArchive)
|
if (null != VFS.CurrentArchive)
|
||||||
|
|||||||
Reference in New Issue
Block a user