MultiDiskBundler - fix exception on load when the current rom is in an archive

This commit is contained in:
adelikat 2015-05-10 20:04:27 +00:00
parent ea72da9f89
commit c80fb97bc9
1 changed files with 14 additions and 1 deletions

View File

@ -27,7 +27,20 @@ namespace BizHawk.Client.EmuHawk
{
if (!Global.Game.IsNullInstance)
{
NameBox.Text = Path.ChangeExtension(GlobalWin.MainForm.CurrentlyOpenRom, ".xml");
string currentRom = GlobalWin.MainForm.CurrentlyOpenRom;
if (GlobalWin.MainForm.CurrentlyOpenRom.Contains("|"))
{
var pieces = GlobalWin.MainForm.CurrentlyOpenRom.Split('|');
var directory = Path.GetDirectoryName(pieces[0]);
var filename = Path.ChangeExtension(pieces[1], ".xml");
NameBox.Text = Path.Combine(directory, filename);
}
else
{
NameBox.Text = Path.ChangeExtension(GlobalWin.MainForm.CurrentlyOpenRom, ".xml");
}
}
AddButton_Click(null, null);