VirtualPads - PSX NeGcon support, also slider controls now support vertical orientation
This commit is contained in:
parent
0d853fd74a
commit
ba4af238b7
|
@ -110,7 +110,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Location = UIHelper.Scale(button.Location),
|
Location = UIHelper.Scale(button.Location),
|
||||||
Size = UIHelper.Scale(button.TargetSize),
|
Size = UIHelper.Scale(button.TargetSize),
|
||||||
MinValue = button.MinValue,
|
MinValue = button.MinValue,
|
||||||
MaxValue = button.MaxValue
|
MaxValue = button.MaxValue,
|
||||||
|
Orientation = button.Orientation
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case PadSchema.PadInputType.DiscManager:
|
case PadSchema.PadInputType.DiscManager:
|
||||||
|
|
|
@ -28,54 +28,55 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.AnalogTrackBar = new System.Windows.Forms.TrackBar();
|
this.AnalogTrackBar = new System.Windows.Forms.TrackBar();
|
||||||
this.DisplayNameLabel = new System.Windows.Forms.Label();
|
this.DisplayNameLabel = new System.Windows.Forms.Label();
|
||||||
this.ValueLabel = new System.Windows.Forms.Label();
|
this.ValueLabel = new System.Windows.Forms.Label();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.AnalogTrackBar)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.AnalogTrackBar)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// AnalogTrackBar
|
// AnalogTrackBar
|
||||||
//
|
//
|
||||||
this.AnalogTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
this.AnalogTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.AnalogTrackBar.Location = new System.Drawing.Point(3, 3);
|
this.AnalogTrackBar.Location = new System.Drawing.Point(3, 3);
|
||||||
this.AnalogTrackBar.Name = "AnalogTrackBar";
|
this.AnalogTrackBar.Name = "AnalogTrackBar";
|
||||||
this.AnalogTrackBar.Size = new System.Drawing.Size(299, 45);
|
this.AnalogTrackBar.Size = new System.Drawing.Size(291, 45);
|
||||||
this.AnalogTrackBar.TabIndex = 0;
|
this.AnalogTrackBar.TabIndex = 0;
|
||||||
this.AnalogTrackBar.ValueChanged += new System.EventHandler(this.AnalogTrackBar_ValueChanged);
|
this.AnalogTrackBar.ValueChanged += new System.EventHandler(this.AnalogTrackBar_ValueChanged);
|
||||||
//
|
//
|
||||||
// DisplayNameLabel
|
// DisplayNameLabel
|
||||||
//
|
//
|
||||||
this.DisplayNameLabel.AutoSize = true;
|
this.DisplayNameLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.DisplayNameLabel.Location = new System.Drawing.Point(13, 51);
|
this.DisplayNameLabel.AutoSize = true;
|
||||||
this.DisplayNameLabel.Name = "DisplayNameLabel";
|
this.DisplayNameLabel.Location = new System.Drawing.Point(6, 51);
|
||||||
this.DisplayNameLabel.Size = new System.Drawing.Size(33, 13);
|
this.DisplayNameLabel.Name = "DisplayNameLabel";
|
||||||
this.DisplayNameLabel.TabIndex = 1;
|
this.DisplayNameLabel.Size = new System.Drawing.Size(33, 13);
|
||||||
this.DisplayNameLabel.Text = "Slider";
|
this.DisplayNameLabel.TabIndex = 1;
|
||||||
//
|
this.DisplayNameLabel.Text = "Slider";
|
||||||
// ValueLabel
|
//
|
||||||
//
|
// ValueLabel
|
||||||
this.ValueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
//
|
||||||
this.ValueLabel.AutoSize = true;
|
this.ValueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.ValueLabel.Location = new System.Drawing.Point(265, 51);
|
this.ValueLabel.AutoSize = true;
|
||||||
this.ValueLabel.Name = "ValueLabel";
|
this.ValueLabel.Location = new System.Drawing.Point(257, 51);
|
||||||
this.ValueLabel.Size = new System.Drawing.Size(37, 13);
|
this.ValueLabel.Name = "ValueLabel";
|
||||||
this.ValueLabel.TabIndex = 2;
|
this.ValueLabel.Size = new System.Drawing.Size(37, 13);
|
||||||
this.ValueLabel.Text = "99999";
|
this.ValueLabel.TabIndex = 2;
|
||||||
//
|
this.ValueLabel.Text = "99999";
|
||||||
// VirtualPadAnalogButton
|
//
|
||||||
//
|
// VirtualPadAnalogButton
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.Controls.Add(this.ValueLabel);
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.Controls.Add(this.DisplayNameLabel);
|
this.Controls.Add(this.ValueLabel);
|
||||||
this.Controls.Add(this.AnalogTrackBar);
|
this.Controls.Add(this.DisplayNameLabel);
|
||||||
this.Name = "VirtualPadAnalogButton";
|
this.Controls.Add(this.AnalogTrackBar);
|
||||||
this.Size = new System.Drawing.Size(338, 74);
|
this.Name = "VirtualPadAnalogButton";
|
||||||
this.Load += new System.EventHandler(this.VirtualPadAnalogButton_Load);
|
this.Size = new System.Drawing.Size(297, 74);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.AnalogTrackBar)).EndInit();
|
this.Load += new System.EventHandler(this.VirtualPadAnalogButton_Load);
|
||||||
this.ResumeLayout(false);
|
((System.ComponentModel.ISupportInitialize)(this.AnalogTrackBar)).EndInit();
|
||||||
this.PerformLayout();
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
if (AnalogTrackBar == null) return;
|
||||||
//try to base it on the width, lets make a tick every 10 pixels at the minimum
|
//try to base it on the width, lets make a tick every 10 pixels at the minimum
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
using BizHawk.Emulation.Cores.Sony.PSX;
|
using BizHawk.Emulation.Cores.Sony.PSX;
|
||||||
|
@ -320,7 +321,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return new PadSchema
|
return new PadSchema
|
||||||
{
|
{
|
||||||
IsConsole = false,
|
IsConsole = false,
|
||||||
DefaultSize = new Size(240, 115),
|
DefaultSize = new Size(343, 195),
|
||||||
DisplayName = "NeGcon Player" + controller,
|
DisplayName = "NeGcon Player" + controller,
|
||||||
Buttons = new[]
|
Buttons = new[]
|
||||||
{
|
{
|
||||||
|
@ -329,7 +330,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Name = "P" + controller + " Up",
|
Name = "P" + controller + " Up",
|
||||||
DisplayName = "",
|
DisplayName = "",
|
||||||
Icon = Properties.Resources.BlueUp,
|
Icon = Properties.Resources.BlueUp,
|
||||||
Location = new Point(37, 55),
|
Location = new Point(36, 83),
|
||||||
Type = PadSchema.PadInputType.Boolean
|
Type = PadSchema.PadInputType.Boolean
|
||||||
},
|
},
|
||||||
new PadSchema.ButtonScema
|
new PadSchema.ButtonScema
|
||||||
|
@ -337,7 +338,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Name = "P" + controller + " Down",
|
Name = "P" + controller + " Down",
|
||||||
DisplayName = "",
|
DisplayName = "",
|
||||||
Icon = Properties.Resources.BlueDown,
|
Icon = Properties.Resources.BlueDown,
|
||||||
Location = new Point(37, 76),
|
Location = new Point(36, 104),
|
||||||
Type = PadSchema.PadInputType.Boolean
|
Type = PadSchema.PadInputType.Boolean
|
||||||
},
|
},
|
||||||
new PadSchema.ButtonScema
|
new PadSchema.ButtonScema
|
||||||
|
@ -345,7 +346,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Name = "P" + controller + " Left",
|
Name = "P" + controller + " Left",
|
||||||
DisplayName = "",
|
DisplayName = "",
|
||||||
Icon = Properties.Resources.Back,
|
Icon = Properties.Resources.Back,
|
||||||
Location = new Point(16, 67),
|
Location = new Point(15, 95),
|
||||||
Type = PadSchema.PadInputType.Boolean
|
Type = PadSchema.PadInputType.Boolean
|
||||||
},
|
},
|
||||||
new PadSchema.ButtonScema
|
new PadSchema.ButtonScema
|
||||||
|
@ -353,9 +354,81 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Name = "P" + controller + " Right",
|
Name = "P" + controller + " Right",
|
||||||
DisplayName = "",
|
DisplayName = "",
|
||||||
Icon = Properties.Resources.Forward,
|
Icon = Properties.Resources.Forward,
|
||||||
Location = new Point(58, 67),
|
Location = new Point(57, 95),
|
||||||
Type = PadSchema.PadInputType.Boolean
|
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,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
|
@ -37,6 +38,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public int MidValueSec { get; set; }
|
public int MidValueSec { get; set; }
|
||||||
public int MinValueSec { get; set; }
|
public int MinValueSec { get; set; }
|
||||||
public object OwnerEmulator { get; set; }
|
public object OwnerEmulator { get; set; }
|
||||||
|
|
||||||
|
public Orientation Orientation { get; set; } // For Single Flaot controls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue