diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index 2037154cfa..046f708f9d 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -169,6 +169,12 @@ ControllerConfig.cs + + UserControl + + + ControllerConfigPanel.cs + Component @@ -460,6 +466,9 @@ ControllerConfig.cs + + ControllerConfigPanel.cs + GifAnimator.cs diff --git a/BizHawk.MultiClient/config/ControllerConfig.Designer.cs b/BizHawk.MultiClient/config/ControllerConfig.Designer.cs index dce757b091..997c944cba 100644 --- a/BizHawk.MultiClient/config/ControllerConfig.Designer.cs +++ b/BizHawk.MultiClient/config/ControllerConfig.Designer.cs @@ -32,14 +32,22 @@ this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabControl2 = new System.Windows.Forms.TabControl(); this.tabPage13 = new System.Windows.Forms.TabPage(); + this.NESController1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabPage14 = new System.Windows.Forms.TabPage(); + this.NESController2Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabPage15 = new System.Windows.Forms.TabPage(); + this.NESController3Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabPage16 = new System.Windows.Forms.TabPage(); + this.NESController4Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabPage17 = new System.Windows.Forms.TabPage(); this.tabPage18 = new System.Windows.Forms.TabPage(); + this.NESAutofire1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabPage19 = new System.Windows.Forms.TabPage(); + this.NESAutofire2Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabPage20 = new System.Windows.Forms.TabPage(); + this.NESAutofire3Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabPage21 = new System.Windows.Forms.TabPage(); + this.NESAutofire4Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabControl3 = new System.Windows.Forms.TabControl(); this.tabPage22 = new System.Windows.Forms.TabPage(); @@ -95,15 +103,6 @@ this.tabPage8 = new System.Windows.Forms.TabPage(); this.Cancel = new System.Windows.Forms.Button(); this.OK = new System.Windows.Forms.Button(); - this.NESController1Panel = new BizHawk.MultiClient.NESGamePad(); - this.NESController2Panel = new BizHawk.MultiClient.NESGamePad(); - this.NESController3Panel = new BizHawk.MultiClient.NESGamePad(); - this.NESController4Panel = new BizHawk.MultiClient.NESGamePad(); - this.NESAutofire1Panel = new BizHawk.MultiClient.NESGamePad(); - this.NESAutofire2Panel = new BizHawk.MultiClient.NESGamePad(); - this.NESAutofire3Panel = new BizHawk.MultiClient.NESGamePad(); - this.NESAutofire4Panel = new BizHawk.MultiClient.NESGamePad(); - this.NESConsolePad = new BizHawk.MultiClient.NESConsoleButtons(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabControl2.SuspendLayout(); @@ -111,7 +110,6 @@ this.tabPage14.SuspendLayout(); this.tabPage15.SuspendLayout(); this.tabPage16.SuspendLayout(); - this.tabPage17.SuspendLayout(); this.tabPage18.SuspendLayout(); this.tabPage19.SuspendLayout(); this.tabPage20.SuspendLayout(); @@ -193,6 +191,13 @@ this.tabPage13.Text = "Pad 1"; this.tabPage13.UseVisualStyleBackColor = true; // + // NESController1Panel + // + this.NESController1Panel.Location = new System.Drawing.Point(10, 10); + this.NESController1Panel.Name = "NESController1Panel"; + this.NESController1Panel.Size = new System.Drawing.Size(392, 332); + this.NESController1Panel.TabIndex = 0; + // // tabPage14 // this.tabPage14.Controls.Add(this.NESController2Panel); @@ -204,6 +209,13 @@ this.tabPage14.Text = "Pad 2"; this.tabPage14.UseVisualStyleBackColor = true; // + // NESController2Panel + // + this.NESController2Panel.Location = new System.Drawing.Point(10, 10); + this.NESController2Panel.Name = "NESController2Panel"; + this.NESController2Panel.Size = new System.Drawing.Size(392, 332); + this.NESController2Panel.TabIndex = 0; + // // tabPage15 // this.tabPage15.Controls.Add(this.NESController3Panel); @@ -214,6 +226,13 @@ this.tabPage15.Text = "Pad 3"; this.tabPage15.UseVisualStyleBackColor = true; // + // NESController3Panel + // + this.NESController3Panel.Location = new System.Drawing.Point(10, 10); + this.NESController3Panel.Name = "NESController3Panel"; + this.NESController3Panel.Size = new System.Drawing.Size(392, 332); + this.NESController3Panel.TabIndex = 0; + // // tabPage16 // this.tabPage16.Controls.Add(this.NESController4Panel); @@ -224,9 +243,15 @@ this.tabPage16.Text = "Pad 4"; this.tabPage16.UseVisualStyleBackColor = true; // + // NESController4Panel + // + this.NESController4Panel.Location = new System.Drawing.Point(10, 10); + this.NESController4Panel.Name = "NESController4Panel"; + this.NESController4Panel.Size = new System.Drawing.Size(392, 332); + this.NESController4Panel.TabIndex = 0; + // // tabPage17 // - this.tabPage17.Controls.Add(this.NESConsolePad); this.tabPage17.Location = new System.Drawing.Point(4, 22); this.tabPage17.Name = "tabPage17"; this.tabPage17.Size = new System.Drawing.Size(445, 378); @@ -244,6 +269,13 @@ this.tabPage18.Text = "Autofire 1"; this.tabPage18.UseVisualStyleBackColor = true; // + // NESAutofire1Panel + // + this.NESAutofire1Panel.Location = new System.Drawing.Point(10, 10); + this.NESAutofire1Panel.Name = "NESAutofire1Panel"; + this.NESAutofire1Panel.Size = new System.Drawing.Size(392, 332); + this.NESAutofire1Panel.TabIndex = 0; + // // tabPage19 // this.tabPage19.Controls.Add(this.NESAutofire2Panel); @@ -254,6 +286,13 @@ this.tabPage19.Text = "Autofire 2"; this.tabPage19.UseVisualStyleBackColor = true; // + // NESAutofire2Panel + // + this.NESAutofire2Panel.Location = new System.Drawing.Point(10, 10); + this.NESAutofire2Panel.Name = "NESAutofire2Panel"; + this.NESAutofire2Panel.Size = new System.Drawing.Size(392, 332); + this.NESAutofire2Panel.TabIndex = 0; + // // tabPage20 // this.tabPage20.Controls.Add(this.NESAutofire3Panel); @@ -264,6 +303,13 @@ this.tabPage20.Text = "Autofire 3"; this.tabPage20.UseVisualStyleBackColor = true; // + // NESAutofire3Panel + // + this.NESAutofire3Panel.Location = new System.Drawing.Point(10, 10); + this.NESAutofire3Panel.Name = "NESAutofire3Panel"; + this.NESAutofire3Panel.Size = new System.Drawing.Size(392, 332); + this.NESAutofire3Panel.TabIndex = 0; + // // tabPage21 // this.tabPage21.Controls.Add(this.NESAutofire4Panel); @@ -274,6 +320,13 @@ this.tabPage21.Text = "Autofire 4"; this.tabPage21.UseVisualStyleBackColor = true; // + // NESAutofire4Panel + // + this.NESAutofire4Panel.Location = new System.Drawing.Point(10, 10); + this.NESAutofire4Panel.Name = "NESAutofire4Panel"; + this.NESAutofire4Panel.Size = new System.Drawing.Size(392, 332); + this.NESAutofire4Panel.TabIndex = 0; + // // tabPage2 // this.tabPage2.Controls.Add(this.tabControl3); @@ -838,69 +891,6 @@ this.OK.UseVisualStyleBackColor = true; this.OK.Click += new System.EventHandler(this.OK_Click); // - // NESController1Panel - // - this.NESController1Panel.Location = new System.Drawing.Point(10, 10); - this.NESController1Panel.Name = "NESController1Panel"; - this.NESController1Panel.Size = new System.Drawing.Size(392, 332); - this.NESController1Panel.TabIndex = 0; - // - // NESController2Panel - // - this.NESController2Panel.Location = new System.Drawing.Point(10, 10); - this.NESController2Panel.Name = "NESController2Panel"; - this.NESController2Panel.Size = new System.Drawing.Size(392, 332); - this.NESController2Panel.TabIndex = 0; - // - // NESController3Panel - // - this.NESController3Panel.Location = new System.Drawing.Point(10, 10); - this.NESController3Panel.Name = "NESController3Panel"; - this.NESController3Panel.Size = new System.Drawing.Size(392, 332); - this.NESController3Panel.TabIndex = 0; - // - // NESController4Panel - // - this.NESController4Panel.Location = new System.Drawing.Point(10, 10); - this.NESController4Panel.Name = "NESController4Panel"; - this.NESController4Panel.Size = new System.Drawing.Size(392, 332); - this.NESController4Panel.TabIndex = 0; - // - // NESAutofire1Panel - // - this.NESAutofire1Panel.Location = new System.Drawing.Point(10, 10); - this.NESAutofire1Panel.Name = "NESAutofire1Panel"; - this.NESAutofire1Panel.Size = new System.Drawing.Size(392, 332); - this.NESAutofire1Panel.TabIndex = 0; - // - // NESAutofire2Panel - // - this.NESAutofire2Panel.Location = new System.Drawing.Point(10, 10); - this.NESAutofire2Panel.Name = "NESAutofire2Panel"; - this.NESAutofire2Panel.Size = new System.Drawing.Size(392, 332); - this.NESAutofire2Panel.TabIndex = 0; - // - // NESAutofire3Panel - // - this.NESAutofire3Panel.Location = new System.Drawing.Point(10, 10); - this.NESAutofire3Panel.Name = "NESAutofire3Panel"; - this.NESAutofire3Panel.Size = new System.Drawing.Size(392, 332); - this.NESAutofire3Panel.TabIndex = 0; - // - // NESAutofire4Panel - // - this.NESAutofire4Panel.Location = new System.Drawing.Point(10, 10); - this.NESAutofire4Panel.Name = "NESAutofire4Panel"; - this.NESAutofire4Panel.Size = new System.Drawing.Size(392, 332); - this.NESAutofire4Panel.TabIndex = 0; - // - // NESConsolePad - // - this.NESConsolePad.Location = new System.Drawing.Point(14, 13); - this.NESConsolePad.Name = "NESConsolePad"; - this.NESConsolePad.Size = new System.Drawing.Size(392, 332); - this.NESConsolePad.TabIndex = 1; - // // ControllerConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -921,7 +911,6 @@ this.tabPage14.ResumeLayout(false); this.tabPage15.ResumeLayout(false); this.tabPage16.ResumeLayout(false); - this.tabPage17.ResumeLayout(false); this.tabPage18.ResumeLayout(false); this.tabPage19.ResumeLayout(false); this.tabPage20.ResumeLayout(false); @@ -1013,14 +1002,13 @@ private System.Windows.Forms.TabPage tabPage57; private System.Windows.Forms.TabPage tabPage35; private System.Windows.Forms.TabPage tabPage58; - private NESGamePad NESController1Panel; - private NESGamePad NESController2Panel; - private NESGamePad NESController3Panel; - private NESGamePad NESController4Panel; - private NESGamePad NESAutofire1Panel; - private NESGamePad NESAutofire2Panel; - private NESGamePad NESAutofire3Panel; - private NESGamePad NESAutofire4Panel; - private NESConsoleButtons NESConsolePad; + private ControllerConfigPanel NESController1Panel; + private ControllerConfigPanel NESController2Panel; + private ControllerConfigPanel NESController3Panel; + private ControllerConfigPanel NESController4Panel; + private ControllerConfigPanel NESAutofire1Panel; + private ControllerConfigPanel NESAutofire2Panel; + private ControllerConfigPanel NESAutofire3Panel; + private ControllerConfigPanel NESAutofire4Panel; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/config/ControllerConfig.cs b/BizHawk.MultiClient/config/ControllerConfig.cs index 6c12162794..de122092c9 100644 --- a/BizHawk.MultiClient/config/ControllerConfig.cs +++ b/BizHawk.MultiClient/config/ControllerConfig.cs @@ -18,25 +18,31 @@ namespace BizHawk.MultiClient private void ControllerConfig_Load(object sender, EventArgs e) { - NESController1Panel.ControllerNumber = 1; - NESController1Panel.Autofire = false; - NESController1Panel.Load(); - NESController2Panel.ControllerNumber = 2; - NESController2Panel.Autofire = false; - NESController2Panel.Load(); + NESController1Panel.LoadSettings(Global.Config.NESController[0]); + NESController2Panel.LoadSettings(Global.Config.NESController[1]); + NESController3Panel.LoadSettings(Global.Config.NESController[2]); + NESController4Panel.LoadSettings(Global.Config.NESController[3]); + + //NESController1Panel.ControllerNumber = 1; + //NESController1Panel.Autofire = false; + //NESController1Panel.Load(); + //NESController2Panel.ControllerNumber = 2; + //NESController2Panel.Autofire = false; + //NESController2Panel.Load(); - NESController3Panel.ControllerNumber = 3; - NESController3Panel.Autofire = false; - NESController4Panel.ControllerNumber = 4; - NESController4Panel.Autofire = false; - NESAutofire1Panel.ControllerNumber = 1; - NESAutofire1Panel.Autofire = false; - NESAutofire2Panel.ControllerNumber = 2; - NESAutofire2Panel.Autofire = false; - NESAutofire3Panel.ControllerNumber = 3; - NESAutofire3Panel.Autofire = false; - NESAutofire4Panel.ControllerNumber = 4; - NESAutofire4Panel.Autofire = false; + //NESController3Panel.ControllerNumber = 3; + //NESController3Panel.Autofire = false; + //NESController4Panel.ControllerNumber = 4; + //NESController4Panel.Autofire = false; + //NESAutofire1Panel.ControllerNumber = 1; + //NESAutofire1Panel.Autofire = false; + //NESAutofire2Panel.ControllerNumber = 2; + //NESAutofire2Panel.Autofire = false; + //NESAutofire3Panel.ControllerNumber = 3; + //NESAutofire3Panel.Autofire = false; + //NESAutofire4Panel.ControllerNumber = 4; + //NESAutofire4Panel.Autofire = false; + SetAutoTab(true); } @@ -81,6 +87,8 @@ namespace BizHawk.MultiClient { NESController1Panel.Save(); NESController2Panel.Save(); + NESController3Panel.Save(); + NESController4Panel.Save(); Global.OSD.AddMessage("Controller settings saved"); Close(); diff --git a/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.Designer.cs b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.Designer.cs new file mode 100644 index 0000000000..b59ab12123 --- /dev/null +++ b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.Designer.cs @@ -0,0 +1,45 @@ +namespace BizHawk.MultiClient +{ + partial class ControllerConfigPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // ControllerConfigPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "ControllerConfigPanel"; + this.Load += new System.EventHandler(this.ControllerConfigPanel_Load); + this.ResumeLayout(false); + + } + + #endregion + } +} diff --git a/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs new file mode 100644 index 0000000000..4b0545a280 --- /dev/null +++ b/BizHawk.MultiClient/config/ControllerConfig/ControllerConfigPanel.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Reflection; +using System.Windows.Forms; + +namespace BizHawk.MultiClient +{ + public partial class ControllerConfigPanel : UserControl + { + object ControllerConfigObject; //Object that values will be saved to (In Config.cs) + + public static List buttons = new List(); + public int ControllerNumber = 1; + public bool Autofire = false; + + public int InputMarginLeft = 0; + public int LabelPadding = 10; + + public int MarginTop = 0; + public int Spacing = 30; + public int InputSize = 200; + + protected List Inputs = new List(); + protected List