Virtualpads - wire up read-only toggle behavior and remove hacky button
This commit is contained in:
parent
5676a4a0b3
commit
fcc3ce214b
|
@ -96,6 +96,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
Pads.ForEach(p => p.ReadOnly ^= true);
|
||||
}
|
||||
|
||||
public void SetReadOnly(bool readOnly)
|
||||
{
|
||||
Pads.ForEach(p => p.ReadOnly = readOnly);
|
||||
}
|
||||
|
||||
public void Set(IController controller)
|
||||
{
|
||||
Pads.ForEach(c => c.Set(controller));
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
this.PadsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ClearAllMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.StickyMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.DebugReadonlyButton = new System.Windows.Forms.Button();
|
||||
this.PadMenu.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
|
@ -189,22 +188,11 @@
|
|||
this.StickyMenuItem.Text = "Sticky";
|
||||
this.StickyMenuItem.Click += new System.EventHandler(this.StickyMenuItem_Click);
|
||||
//
|
||||
// DebugReadonlyButton
|
||||
//
|
||||
this.DebugReadonlyButton.Location = new System.Drawing.Point(265, 26);
|
||||
this.DebugReadonlyButton.Name = "DebugReadonlyButton";
|
||||
this.DebugReadonlyButton.Size = new System.Drawing.Size(175, 23);
|
||||
this.DebugReadonlyButton.TabIndex = 12;
|
||||
this.DebugReadonlyButton.Text = "ReadOnlyToggle delete me";
|
||||
this.DebugReadonlyButton.UseVisualStyleBackColor = true;
|
||||
this.DebugReadonlyButton.Click += new System.EventHandler(this.DebugReadonlyButton_Click);
|
||||
//
|
||||
// VirtualpadTool
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(452, 312);
|
||||
this.Controls.Add(this.DebugReadonlyButton);
|
||||
this.Controls.Add(this.ControllerBox);
|
||||
this.Controls.Add(this.StickyBox);
|
||||
this.Controls.Add(this.ClearButton);
|
||||
|
@ -238,6 +226,5 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem ClearAllMenuItem;
|
||||
private System.Windows.Forms.GroupBox ControllerBox;
|
||||
private System.Windows.Forms.ToolStripMenuItem StickyMenuItem;
|
||||
private System.Windows.Forms.Button DebugReadonlyButton;
|
||||
}
|
||||
}
|
|
@ -122,8 +122,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (Global.MovieSession.Movie.IsPlaying && !Global.MovieSession.Movie.IsFinished && Global.Emulator.Frame > 0)
|
||||
{
|
||||
Pads.ForEach(p => p.SetReadOnly(true));
|
||||
Pads.ForEach(p => p.Set(Global.MovieSession.CurrentInput));
|
||||
}
|
||||
else
|
||||
{
|
||||
Pads.ForEach(p => p.SetReadOnly(false));
|
||||
}
|
||||
|
||||
// TODO
|
||||
//if (!StickyBox.Checked)
|
||||
|
@ -200,11 +205,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#endregion
|
||||
|
||||
private void DebugReadonlyButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Pads.ForEach(p => p.ToggleReadOnly());
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue