parent
a471206d6a
commit
c4167555ae
|
@ -82,11 +82,13 @@ namespace BizHawk.Client.Common
|
||||||
using (var hf = new HawkFile(fullpath))
|
using (var hf = new HawkFile(fullpath))
|
||||||
{
|
{
|
||||||
if (hf.IsArchive)
|
if (hf.IsArchive)
|
||||||
{
|
{
|
||||||
var archiveItem = hf.ArchiveItems.First(ai => ai.Name == filename.Split('|').Skip(1).First());
|
var archiveItem = hf.ArchiveItems.First(ai => ai.Name == filename.Split('|').Skip(1).First());
|
||||||
hf.Unbind();
|
hf.Unbind();
|
||||||
hf.BindArchiveMember(archiveItem);
|
hf.BindArchiveMember(archiveItem);
|
||||||
data = hf.GetStream().ReadAllBytes();
|
data = hf.GetStream().ReadAllBytes();
|
||||||
|
|
||||||
|
filename = filename.Split('|').Skip(1).First();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -114,7 +114,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
GlobalWin.MainForm.LoadRom(fileInfo.FullName, new MainForm.LoadRomArgs() { OpenAdvanced = new OpenAdvanced_OpenRom() });
|
var lra = new MainForm.LoadRomArgs { OpenAdvanced = new OpenAdvanced_OpenRom { Path = fileInfo.FullName } };
|
||||||
|
GlobalWin.MainForm.LoadRom(fileInfo.FullName, lra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,16 +131,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top
|
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top
|
||||||
};
|
};
|
||||||
|
|
||||||
var mdf = new MultiDiskFileSelector
|
var mdf = new MultiDiskFileSelector
|
||||||
{
|
{
|
||||||
Location = UIHelper.Scale(new Point(7, 12)),
|
Location = UIHelper.Scale(new Point(7, 12)),
|
||||||
Width = groupBox.ClientSize.Width - UIHelper.ScaleX(13),
|
Width = groupBox.ClientSize.Width - UIHelper.ScaleX(13),
|
||||||
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top
|
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top
|
||||||
};
|
};
|
||||||
|
|
||||||
mdf.NameChanged += FileSelector_NameChanged;
|
mdf.NameChanged += FileSelector_NameChanged;
|
||||||
|
mdf.SystemString = SystemDropDown.SelectedText;
|
||||||
|
|
||||||
groupBox.Controls.Add(mdf);
|
|
||||||
|
groupBox.Controls.Add(mdf);
|
||||||
|
|
||||||
FileSelectorPanel.Controls.Add(groupBox);
|
FileSelectorPanel.Controls.Add(groupBox);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,14 @@ using System.Windows.Forms;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
using BizHawk.Client.Common;
|
||||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public partial class MultiDiskFileSelector : UserControl
|
public partial class MultiDiskFileSelector : UserControl
|
||||||
{
|
{
|
||||||
|
public string SystemString = "";
|
||||||
|
|
||||||
public string GetName()
|
public string GetName()
|
||||||
{
|
{
|
||||||
return PathBox.Text;
|
return PathBox.Text;
|
||||||
|
@ -74,11 +77,56 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
string _path = "";
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog();
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
PathBox.Text = ofd.FileName;
|
_path = ofd.FileName;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var file = new FileInfo(ofd.FileName);
|
||||||
|
var path = BizHawk.Common.HawkFile.Util_ResolveLink(file.FullName);
|
||||||
|
|
||||||
|
using (var hf = new BizHawk.Common.HawkFile(path))
|
||||||
|
{
|
||||||
|
if (hf.IsArchive)
|
||||||
|
{
|
||||||
|
// archive - run the archive chooser
|
||||||
|
if (SystemString == "PSX" || SystemString == "PCFX" || SystemString == "SAT")
|
||||||
|
{
|
||||||
|
MessageBox.Show("Using archives with PSX, PCFX or SATURN is not currently recommended/supported.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ac = new ArchiveChooser(new BizHawk.Common.HawkFile(_path));
|
||||||
|
int memIdx = -1;
|
||||||
|
|
||||||
|
if (ac.ShowDialog(this) == DialogResult.OK)
|
||||||
|
{
|
||||||
|
memIdx = ac.SelectedMemberIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
var intName = hf.ArchiveItems[memIdx];
|
||||||
|
PathBox.Text = _path + "|" + intName.Name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// file is not an archive
|
||||||
|
PathBox.Text = _path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue