Multi-Disk bundler - add a system picker, with GB and Apple II as they are currently the only systems that support this

This commit is contained in:
adelikat 2015-05-17 20:26:25 +00:00
parent 5a03e96932
commit c9f4a27fcd
2 changed files with 43 additions and 3 deletions

View File

@ -37,6 +37,8 @@
this.NameBox = new System.Windows.Forms.TextBox();
this.FileSelectorPanel = new System.Windows.Forms.Panel();
this.AddButton = new System.Windows.Forms.Button();
this.SystemDropDown = new System.Windows.Forms.ComboBox();
this.SystemLabel = new System.Windows.Forms.Label();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
@ -113,9 +115,9 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.FileSelectorPanel.AutoScroll = true;
this.FileSelectorPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.FileSelectorPanel.Location = new System.Drawing.Point(8, 79);
this.FileSelectorPanel.Location = new System.Drawing.Point(8, 101);
this.FileSelectorPanel.Name = "FileSelectorPanel";
this.FileSelectorPanel.Size = new System.Drawing.Size(486, 244);
this.FileSelectorPanel.Size = new System.Drawing.Size(486, 222);
this.FileSelectorPanel.TabIndex = 12;
//
// AddButton
@ -129,11 +131,36 @@
this.AddButton.UseVisualStyleBackColor = true;
this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
//
// SystemDropDown
//
this.SystemDropDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.SystemDropDown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.SystemDropDown.FormattingEnabled = true;
this.SystemDropDown.Items.AddRange(new object[] {
"GB",
"Apple II"});
this.SystemDropDown.Location = new System.Drawing.Point(425, 75);
this.SystemDropDown.Name = "SystemDropDown";
this.SystemDropDown.Size = new System.Drawing.Size(69, 21);
this.SystemDropDown.TabIndex = 14;
//
// SystemLabel
//
this.SystemLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.SystemLabel.AutoSize = true;
this.SystemLabel.Location = new System.Drawing.Point(375, 78);
this.SystemLabel.Name = "SystemLabel";
this.SystemLabel.Size = new System.Drawing.Size(44, 13);
this.SystemLabel.TabIndex = 15;
this.SystemLabel.Text = "System:";
//
// MultiDiskBundler
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(506, 364);
this.Controls.Add(this.SystemLabel);
this.Controls.Add(this.SystemDropDown);
this.Controls.Add(this.AddButton);
this.Controls.Add(this.FileSelectorPanel);
this.Controls.Add(this.groupBox3);
@ -163,5 +190,7 @@
private System.Windows.Forms.Panel FileSelectorPanel;
private System.Windows.Forms.Button AddButton;
private System.Windows.Forms.Button BrowseBtn;
private System.Windows.Forms.ComboBox SystemDropDown;
private System.Windows.Forms.Label SystemLabel;
}
}

View File

@ -11,6 +11,7 @@ using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Xml.Linq;
using BizHawk.Client.EmuHawk.WinFormExtensions;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk
{
@ -41,6 +42,11 @@ namespace BizHawk.Client.EmuHawk
{
NameBox.Text = Path.ChangeExtension(GlobalWin.MainForm.CurrentlyOpenRom, ".xml");
}
if (SystemDropDown.Items.Contains(Global.Emulator.SystemId))
{
SystemDropDown.SelectedItem = Global.Emulator.SystemId;
}
}
AddButton_Click(null, null);
@ -171,7 +177,12 @@ namespace BizHawk.Client.EmuHawk
throw new Exception("Blank Names");
}
string system = Global.Emulator.SystemId; // TODO: have the user pick this?
var system = SystemDropDown.SelectedItem.ToString();
if (system == null)
{
throw new Exception("Blank System Id");
}
var basePath = Path.GetDirectoryName(name.Split('|').First());