diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index 357ec74f85..be378cffc0 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -276,7 +276,7 @@ Cheats.cs - + Component @@ -352,6 +352,9 @@ ToolBox.cs + + Component + @@ -436,8 +439,8 @@ Cheats.cs Designer - - Pad.cs + + VirtualPad.cs Designer diff --git a/BizHawk.MultiClient/tools/TAStudio.Designer.cs b/BizHawk.MultiClient/tools/TAStudio.Designer.cs index 8ff9f6b900..abb92c22da 100644 --- a/BizHawk.MultiClient/tools/TAStudio.Designer.cs +++ b/BizHawk.MultiClient/tools/TAStudio.Designer.cs @@ -71,7 +71,7 @@ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.Pad1 = new BizHawk.MultiClient.VirtualPad(); + this.Pad1 = new BizHawk.MultiClient.VirtualPadNES(); this.menuStrip1.SuspendLayout(); this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); this.toolStripContainer1.SuspendLayout(); @@ -89,7 +89,7 @@ this.settingsToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(844, 24); + this.menuStrip1.Size = new System.Drawing.Size(789, 24); this.menuStrip1.TabIndex = 0; this.menuStrip1.Text = "menuStrip1"; // @@ -354,7 +354,7 @@ this.toolStripSeparator4}); this.toolStrip2.Location = new System.Drawing.Point(3, 25); this.toolStrip2.Name = "toolStrip2"; - this.toolStrip2.Size = new System.Drawing.Size(93, 25); + this.toolStrip2.Size = new System.Drawing.Size(62, 25); this.toolStrip2.TabIndex = 1; // // StopButton @@ -428,7 +428,7 @@ this.groupBox1.Controls.Add(this.Pad1); this.groupBox1.Location = new System.Drawing.Point(373, 108); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(445, 280); + this.groupBox1.Size = new System.Drawing.Size(401, 197); this.groupBox1.TabIndex = 4; this.groupBox1.TabStop = false; this.groupBox1.Text = "Controllers"; @@ -438,14 +438,14 @@ this.Pad1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.Pad1.Location = new System.Drawing.Point(6, 19); this.Pad1.Name = "Pad1"; - this.Pad1.Size = new System.Drawing.Size(176, 80); + this.Pad1.Size = new System.Drawing.Size(174, 74); this.Pad1.TabIndex = 0; // // TAStudio // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(844, 474); + this.ClientSize = new System.Drawing.Size(789, 474); this.Controls.Add(this.groupBox1); this.Controls.Add(this.ReadOnlyCheckBox); this.Controls.Add(this.toolStripContainer1); @@ -516,6 +516,6 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; private System.Windows.Forms.GroupBox groupBox1; - private VirtualPad Pad1; + private VirtualPadNES Pad1; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/TAStudio.cs b/BizHawk.MultiClient/tools/TAStudio.cs index d810891a5b..5117cf3fc9 100644 --- a/BizHawk.MultiClient/tools/TAStudio.cs +++ b/BizHawk.MultiClient/tools/TAStudio.cs @@ -12,6 +12,7 @@ namespace BizHawk.MultiClient public partial class TAStudio : Form { //TODO: + //Crash when closing TASStudio //Right-click - Go to current frame //Clicking a frame should go there @@ -36,9 +37,8 @@ namespace BizHawk.MultiClient public string GetMnemonic() { - StringBuilder str = new StringBuilder(""); + StringBuilder str = new StringBuilder("|0|"); //TODO: Control Command virtual pad str.Append(Pad1.GetMnemonic()); - //Loop through active controllers and append string data return str.ToString(); } diff --git a/BizHawk.MultiClient/tools/TAStudio.resx b/BizHawk.MultiClient/tools/TAStudio.resx index 8bd8ebb331..58e7d0174f 100644 --- a/BizHawk.MultiClient/tools/TAStudio.resx +++ b/BizHawk.MultiClient/tools/TAStudio.resx @@ -145,6 +145,9 @@ 324, 17 + + 324, 17 + 416, 17 diff --git a/BizHawk.MultiClient/tools/VirtualPad.cs b/BizHawk.MultiClient/tools/VirtualPad.cs new file mode 100644 index 0000000000..a588032ae7 --- /dev/null +++ b/BizHawk.MultiClient/tools/VirtualPad.cs @@ -0,0 +1,44 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Globalization; + +namespace BizHawk.MultiClient +{ + public class VirtualPad : Panel + { + + public Point[] ButtonPoints = new Point[8]; + + + public CheckBox PU; + public CheckBox PD; + public CheckBox PL; + public CheckBox PR; + public CheckBox B1; + public CheckBox B2; + public CheckBox B3; + public CheckBox B4; + public CheckBox B5; + public CheckBox B6; + public CheckBox B7; + public CheckBox B8; + + public VirtualPad() + { + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + this.BorderStyle = BorderStyle.Fixed3D; + this.Size = new Size(174, 74); + } + + public virtual string GetMnemonic() + { + return "......|"; + } + } +} diff --git a/BizHawk.MultiClient/tools/Pad.resx b/BizHawk.MultiClient/tools/VirtualPad.resx similarity index 100% rename from BizHawk.MultiClient/tools/Pad.resx rename to BizHawk.MultiClient/tools/VirtualPad.resx diff --git a/BizHawk.MultiClient/tools/Pad.cs b/BizHawk.MultiClient/tools/VirtualPadNES.cs similarity index 70% rename from BizHawk.MultiClient/tools/Pad.cs rename to BizHawk.MultiClient/tools/VirtualPadNES.cs index 13921bf98f..6770d7bee4 100644 --- a/BizHawk.MultiClient/tools/Pad.cs +++ b/BizHawk.MultiClient/tools/VirtualPadNES.cs @@ -8,43 +8,26 @@ using System.Globalization; namespace BizHawk.MultiClient { - public class VirtualPad : Panel + public class VirtualPadNES : VirtualPad { - public enum ControllerType { NES, SMS, PCE } - Point[] NESPoints = new Point[8]; - public ControllerType Controller; - public CheckBox PU; - public CheckBox PD; - public CheckBox PL; - public CheckBox PR; - public CheckBox B1; - public CheckBox B2; - public CheckBox B3; - public CheckBox B4; - public CheckBox B5; - public CheckBox B6; - public CheckBox B7; - public CheckBox B8; - - public VirtualPad() + public VirtualPadNES() { - Controller = ControllerType.NES; //Default - NESPoints[0] = new Point(14, 2); - NESPoints[1] = new Point(14, 46); - NESPoints[2] = new Point(2, 24); - NESPoints[3] = new Point(24, 24); - NESPoints[4] = new Point(52, 24); - NESPoints[5] = new Point(74, 24); - NESPoints[6] = new Point(122, 24); - NESPoints[7] = new Point(146, 24); + ButtonPoints[0] = new Point(14, 2); + ButtonPoints[1] = new Point(14, 46); + ButtonPoints[2] = new Point(2, 24); + ButtonPoints[3] = new Point(24, 24); + ButtonPoints[4] = new Point(52, 24); + ButtonPoints[5] = new Point(74, 24); + ButtonPoints[6] = new Point(122, 24); + ButtonPoints[7] = new Point(146, 24); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); this.BorderStyle = BorderStyle.Fixed3D; this.Paint += new System.Windows.Forms.PaintEventHandler(this.VirtualPad_Paint); - this.Size = new Size(174, 164); + this.Size = new Size(174, 74); Point n = new Point(this.Size); @@ -53,16 +36,16 @@ namespace BizHawk.MultiClient this.PU.AutoSize = true; this.PU.Image = global::BizHawk.MultiClient.Properties.Resources.BlueUp; this.PU.ImageAlign = System.Drawing.ContentAlignment.BottomRight; - this.PU.Location = NESPoints[0]; + this.PU.Location = ButtonPoints[0]; this.PU.TabIndex = 1; - this.PU.UseVisualStyleBackColor = true; ; + this.PU.UseVisualStyleBackColor = true; this.PD = new CheckBox(); this.PD.Appearance = System.Windows.Forms.Appearance.Button; this.PD.AutoSize = true; this.PD.Image = global::BizHawk.MultiClient.Properties.Resources.BlueDown; this.PD.ImageAlign = System.Drawing.ContentAlignment.BottomRight; - this.PD.Location = NESPoints[1]; + this.PD.Location = ButtonPoints[1]; this.PD.TabIndex = 4; this.PD.UseVisualStyleBackColor = true; @@ -71,7 +54,7 @@ namespace BizHawk.MultiClient this.PR.AutoSize = true; this.PR.Image = global::BizHawk.MultiClient.Properties.Resources.Forward; this.PR.ImageAlign = System.Drawing.ContentAlignment.BottomRight; - this.PR.Location = NESPoints[3]; + this.PR.Location = ButtonPoints[3]; this.PR.TabIndex = 3; this.PR.UseVisualStyleBackColor = true; @@ -80,14 +63,14 @@ namespace BizHawk.MultiClient this.PL.AutoSize = true; this.PL.Image = global::BizHawk.MultiClient.Properties.Resources.Back; this.PL.ImageAlign = System.Drawing.ContentAlignment.BottomRight; - this.PL.Location = NESPoints[2]; + this.PL.Location = ButtonPoints[2]; this.PL.TabIndex = 2; this.PL.UseVisualStyleBackColor = true; this.B1 = new CheckBox(); this.B1.Appearance = System.Windows.Forms.Appearance.Button; this.B1.AutoSize = true; - this.B1.Location = NESPoints[4]; + this.B1.Location = ButtonPoints[4]; this.B1.TabIndex = 5; this.B1.Text = "s"; this.B1.TextAlign = System.Drawing.ContentAlignment.BottomCenter; @@ -96,7 +79,7 @@ namespace BizHawk.MultiClient this.B2 = new CheckBox(); this.B2.Appearance = System.Windows.Forms.Appearance.Button; this.B2.AutoSize = true; - this.B2.Location = NESPoints[5]; + this.B2.Location = ButtonPoints[5]; this.B2.TabIndex = 6; this.B2.Text = "S"; this.B2.TextAlign = System.Drawing.ContentAlignment.BottomCenter; @@ -105,7 +88,7 @@ namespace BizHawk.MultiClient this.B3 = new CheckBox(); this.B3.Appearance = System.Windows.Forms.Appearance.Button; this.B3.AutoSize = true; - this.B3.Location = NESPoints[6]; + this.B3.Location = ButtonPoints[6]; this.B3.TabIndex = 7; this.B3.Text = "B"; this.B3.TextAlign = System.Drawing.ContentAlignment.BottomCenter; @@ -114,7 +97,7 @@ namespace BizHawk.MultiClient this.B4 = new CheckBox(); this.B4.Appearance = System.Windows.Forms.Appearance.Button; this.B4.AutoSize = true; - this.B4.Location = NESPoints[7]; + this.B4.Location = ButtonPoints[7]; this.B4.TabIndex = 8; this.B4.Text = "A"; this.B4.TextAlign = System.Drawing.ContentAlignment.BottomCenter; @@ -161,21 +144,7 @@ namespace BizHawk.MultiClient } - public string GetMnemonic() - { - switch (Controller) - { - default: - case ControllerType.NES: - return GetMnemonicNES(); - case ControllerType.PCE: - return GetMnemonicPCE(); - case ControllerType.SMS: - return GetMnemonicSMS(); - } - } - - public string GetMnemonicNES() + public override string GetMnemonic() { StringBuilder input = new StringBuilder("|0|"); //TODO: Reset button input.Append(PR.Checked ? "R" : "."); @@ -190,15 +159,5 @@ namespace BizHawk.MultiClient input.Append("|"); return input.ToString(); } - - private string GetMnemonicPCE() - { - return ""; - } - - private string GetMnemonicSMS() - { - return ""; - } } }