diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualPad.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualPad.cs index 1c1935bb36..c2323cfaa8 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualPad.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualPad.cs @@ -110,7 +110,8 @@ namespace BizHawk.Client.EmuHawk Location = UIHelper.Scale(button.Location), Size = UIHelper.Scale(button.TargetSize), MinValue = button.MinValue, - MaxValue = button.MaxValue + MaxValue = button.MaxValue, + Orientation = button.Orientation }); break; case PadSchema.PadInputType.DiscManager: diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.Designer.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.Designer.cs index 949872c5b9..a5c6bc8341 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.Designer.cs @@ -28,54 +28,55 @@ /// private void InitializeComponent() { - this.AnalogTrackBar = new System.Windows.Forms.TrackBar(); - this.DisplayNameLabel = new System.Windows.Forms.Label(); - this.ValueLabel = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.AnalogTrackBar)).BeginInit(); - this.SuspendLayout(); - // - // AnalogTrackBar - // - this.AnalogTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.AnalogTrackBar = new System.Windows.Forms.TrackBar(); + this.DisplayNameLabel = new System.Windows.Forms.Label(); + this.ValueLabel = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.AnalogTrackBar)).BeginInit(); + this.SuspendLayout(); + // + // AnalogTrackBar + // + this.AnalogTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.AnalogTrackBar.Location = new System.Drawing.Point(3, 3); - this.AnalogTrackBar.Name = "AnalogTrackBar"; - this.AnalogTrackBar.Size = new System.Drawing.Size(299, 45); - this.AnalogTrackBar.TabIndex = 0; - this.AnalogTrackBar.ValueChanged += new System.EventHandler(this.AnalogTrackBar_ValueChanged); - // - // DisplayNameLabel - // - this.DisplayNameLabel.AutoSize = true; - this.DisplayNameLabel.Location = new System.Drawing.Point(13, 51); - this.DisplayNameLabel.Name = "DisplayNameLabel"; - this.DisplayNameLabel.Size = new System.Drawing.Size(33, 13); - this.DisplayNameLabel.TabIndex = 1; - this.DisplayNameLabel.Text = "Slider"; - // - // ValueLabel - // - this.ValueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ValueLabel.AutoSize = true; - this.ValueLabel.Location = new System.Drawing.Point(265, 51); - this.ValueLabel.Name = "ValueLabel"; - this.ValueLabel.Size = new System.Drawing.Size(37, 13); - this.ValueLabel.TabIndex = 2; - this.ValueLabel.Text = "99999"; - // - // VirtualPadAnalogButton - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.ValueLabel); - this.Controls.Add(this.DisplayNameLabel); - this.Controls.Add(this.AnalogTrackBar); - this.Name = "VirtualPadAnalogButton"; - this.Size = new System.Drawing.Size(338, 74); - this.Load += new System.EventHandler(this.VirtualPadAnalogButton_Load); - ((System.ComponentModel.ISupportInitialize)(this.AnalogTrackBar)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.AnalogTrackBar.Location = new System.Drawing.Point(3, 3); + this.AnalogTrackBar.Name = "AnalogTrackBar"; + this.AnalogTrackBar.Size = new System.Drawing.Size(291, 45); + this.AnalogTrackBar.TabIndex = 0; + this.AnalogTrackBar.ValueChanged += new System.EventHandler(this.AnalogTrackBar_ValueChanged); + // + // DisplayNameLabel + // + this.DisplayNameLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.DisplayNameLabel.AutoSize = true; + this.DisplayNameLabel.Location = new System.Drawing.Point(6, 51); + this.DisplayNameLabel.Name = "DisplayNameLabel"; + this.DisplayNameLabel.Size = new System.Drawing.Size(33, 13); + this.DisplayNameLabel.TabIndex = 1; + this.DisplayNameLabel.Text = "Slider"; + // + // ValueLabel + // + this.ValueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.ValueLabel.AutoSize = true; + this.ValueLabel.Location = new System.Drawing.Point(257, 51); + this.ValueLabel.Name = "ValueLabel"; + this.ValueLabel.Size = new System.Drawing.Size(37, 13); + this.ValueLabel.TabIndex = 2; + this.ValueLabel.Text = "99999"; + // + // VirtualPadAnalogButton + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.ValueLabel); + this.Controls.Add(this.DisplayNameLabel); + this.Controls.Add(this.AnalogTrackBar); + this.Name = "VirtualPadAnalogButton"; + this.Size = new System.Drawing.Size(297, 74); + this.Load += new System.EventHandler(this.VirtualPadAnalogButton_Load); + ((System.ComponentModel.ISupportInitialize)(this.AnalogTrackBar)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs index a0c8dfc9d5..03c8a01cfa 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs @@ -153,7 +153,31 @@ namespace BizHawk.Client.EmuHawk } } - void UpdateTickFrequency() + public Orientation Orientation + { + get + { + return AnalogTrackBar.Orientation; + } + + set + { + AnalogTrackBar.Orientation = value; + if (value == Orientation.Horizontal) + { + AnalogTrackBar.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; + AnalogTrackBar.Size = new Size(Size.Width - 15, Size.Height - 15); + } + else if (value == Orientation.Vertical) + { + AnalogTrackBar.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom; + AnalogTrackBar.Size = new Size(Size.Width - 15, Size.Height - 30); + ValueLabel.Top = Size.Height / 2; + } + } + } + + private void UpdateTickFrequency() { if (AnalogTrackBar == null) return; //try to base it on the width, lets make a tick every 10 pixels at the minimum diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs index 8cc2e27b89..1890b81759 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PSXSchema.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Drawing; +using System.Windows.Forms; using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Sony.PSX; @@ -320,7 +321,7 @@ namespace BizHawk.Client.EmuHawk return new PadSchema { IsConsole = false, - DefaultSize = new Size(240, 115), + DefaultSize = new Size(343, 195), DisplayName = "NeGcon Player" + controller, Buttons = new[] { @@ -329,7 +330,7 @@ namespace BizHawk.Client.EmuHawk Name = "P" + controller + " Up", DisplayName = "", Icon = Properties.Resources.BlueUp, - Location = new Point(37, 55), + Location = new Point(36, 83), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema @@ -337,7 +338,7 @@ namespace BizHawk.Client.EmuHawk Name = "P" + controller + " Down", DisplayName = "", Icon = Properties.Resources.BlueDown, - Location = new Point(37, 76), + Location = new Point(36, 104), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema @@ -345,7 +346,7 @@ namespace BizHawk.Client.EmuHawk Name = "P" + controller + " Left", DisplayName = "", Icon = Properties.Resources.Back, - Location = new Point(16, 67), + Location = new Point(15, 95), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema @@ -353,9 +354,81 @@ namespace BizHawk.Client.EmuHawk Name = "P" + controller + " Right", DisplayName = "", Icon = Properties.Resources.Forward, - Location = new Point(58, 67), + Location = new Point(57, 95), Type = PadSchema.PadInputType.Boolean }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Start", + DisplayName = "S", + Location = new Point(78, 118), + Type = PadSchema.PadInputType.Boolean + }, + + new PadSchema.ButtonScema + { + Name = "P" + controller + " B", + DisplayName = "B", + Location = new Point(278, 38), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " A", + DisplayName = "A", + Location = new Point(308, 55), + Type = PadSchema.PadInputType.Boolean + }, + + new PadSchema.ButtonScema + { + Name = "P" + controller + " R", + DisplayName = "R", + Location = new Point(308, 15), + Type = PadSchema.PadInputType.Boolean + }, + + new PadSchema.ButtonScema + { + Name = "P" + controller + " L", + DisplayName = "L", + Location = new Point(5, 15), + Type = PadSchema.PadInputType.FloatSingle, + TargetSize = new Size(128, 55), + MinValue = 0, + MaxValue = 255, + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Twist", + DisplayName = "Twist", + Location = new Point(125, 15), + Type = PadSchema.PadInputType.FloatSingle, + TargetSize = new Size(64, 178), + MinValue = 0, + MaxValue = 255, + Orientation = Orientation.Vertical + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " 2", + DisplayName = "II", + Location = new Point(180, 60), + Type = PadSchema.PadInputType.FloatSingle, + TargetSize = new Size(128, 55), + MinValue = 0, + MaxValue = 255, + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " 1", + DisplayName = "I", + Location = new Point(220, 120), + Type = PadSchema.PadInputType.FloatSingle, + TargetSize = new Size(128, 55), + MinValue = 0, + MaxValue = 255, + }, } }; } diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PadSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PadSchema.cs index fca261cbc6..37a782ee75 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PadSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/PadSchema.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Drawing; +using System.Windows.Forms; namespace BizHawk.Client.EmuHawk { @@ -37,6 +38,8 @@ namespace BizHawk.Client.EmuHawk public int MidValueSec { get; set; } public int MinValueSec { get; set; } public object OwnerEmulator { get; set; } + + public Orientation Orientation { get; set; } // For Single Flaot controls } }