Multi-Disk bundler - fix various issues with the form, most significantly the wrong system Id for AppleII

This commit is contained in:
adelikat 2015-06-21 12:51:48 +00:00
parent 261ae5e323
commit 7e2cfa0dd5
2 changed files with 17 additions and 5 deletions

View File

@ -138,11 +138,12 @@
this.SystemDropDown.FormattingEnabled = true; this.SystemDropDown.FormattingEnabled = true;
this.SystemDropDown.Items.AddRange(new object[] { this.SystemDropDown.Items.AddRange(new object[] {
"GB", "GB",
"Apple II"}); "AppleII"});
this.SystemDropDown.Location = new System.Drawing.Point(425, 75); this.SystemDropDown.Location = new System.Drawing.Point(425, 75);
this.SystemDropDown.Name = "SystemDropDown"; this.SystemDropDown.Name = "SystemDropDown";
this.SystemDropDown.Size = new System.Drawing.Size(69, 21); this.SystemDropDown.Size = new System.Drawing.Size(69, 21);
this.SystemDropDown.TabIndex = 14; this.SystemDropDown.TabIndex = 14;
this.SystemDropDown.SelectedIndexChanged += new System.EventHandler(this.SystemDropDown_SelectedIndexChanged);
// //
// SystemLabel // SystemLabel
// //

View File

@ -166,26 +166,32 @@ namespace BizHawk.Client.EmuHawk
if (string.IsNullOrWhiteSpace(name)) if (string.IsNullOrWhiteSpace(name))
{ {
throw new Exception("Blank Names"); throw new Exception("Xml Filename can not be blank");
} }
if (names.Any(n => string.IsNullOrWhiteSpace(n))) if (names.Any(n => string.IsNullOrWhiteSpace(n)))
{ {
throw new Exception("Blank Names"); throw new Exception("Rom Names can not be blank");
} }
var system = SystemDropDown.SelectedItem.ToString(); var system = SystemDropDown.SelectedItem.ToString();
if (system == null) if (system == null)
{ {
throw new Exception("Blank System Id"); throw new Exception("System Id can not be blank");
} }
var basePath = Path.GetDirectoryName(name.Split('|').First()); var basePath = Path.GetDirectoryName(name.Split('|').First());
if (string.IsNullOrEmpty(basePath))
{
var fileInfo = new FileInfo(name);
basePath = Path.GetDirectoryName(fileInfo.FullName);
}
_currentXml = new XElement("BizHawk-XMLGame", _currentXml = new XElement("BizHawk-XMLGame",
new XAttribute("System", system), new XAttribute("System", system),
new XAttribute("Name", name), new XAttribute("Name", Path.GetFileNameWithoutExtension(name)),
new XElement("LoadAssets", new XElement("LoadAssets",
names.Select(n => new XElement( names.Select(n => new XElement(
"Asset", "Asset",
@ -281,5 +287,10 @@ namespace BizHawk.Client.EmuHawk
throw new FileNotFoundException(); throw new FileNotFoundException();
} }
private void SystemDropDown_SelectedIndexChanged(object sender, EventArgs e)
{
Recalculate();
}
} }
} }