TAStudio - wire up the Auto-restore checkbox, only the ui and the saving to the config, the logic of what it does is not in yet

This commit is contained in:
adelikat 2014-07-28 17:40:17 +00:00
parent 77cae08afa
commit 2ac9395a37
3 changed files with 29 additions and 5 deletions

View File

@ -525,6 +525,7 @@ namespace BizHawk.Client.Common
public bool AutoloadTAStudio = false;
public bool AutoloadTAStudioProject = false;
public bool TAStudioDrawInput = true;
public bool TAStudioAutoRestoreLastPosition = false;
// VirtualPad Dialog
public ToolDialogSettings VirtualPadSettings = new ToolDialogSettings();

View File

@ -63,13 +63,13 @@
// AutoRestoreCheckbox
//
this.AutoRestoreCheckbox.AutoSize = true;
this.AutoRestoreCheckbox.Enabled = false;
this.AutoRestoreCheckbox.Location = new System.Drawing.Point(10, 69);
this.AutoRestoreCheckbox.Name = "AutoRestoreCheckbox";
this.AutoRestoreCheckbox.Size = new System.Drawing.Size(141, 17);
this.AutoRestoreCheckbox.TabIndex = 8;
this.AutoRestoreCheckbox.Text = "Auto-restore last position";
this.AutoRestoreCheckbox.UseVisualStyleBackColor = true;
this.AutoRestoreCheckbox.CheckedChanged += new System.EventHandler(this.AutoRestoreCheckbox_CheckedChanged);
//
// TurboSeekCheckbox
//

View File

@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk
{
public partial class PlaybackBox : UserControl
{
private bool _programmaticallyChangingSeekBox = false;
private bool _programmaticallyChangingValue = false;
public TAStudio Tastudio { get; set; }
@ -31,15 +31,30 @@ namespace BizHawk.Client.EmuHawk
}
}
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
public bool AutoRestore
{
get
{
return Global.Config.TAStudioAutoRestoreLastPosition;
}
set
{
AutoRestoreCheckbox.Checked = Global.Config.TAStudioAutoRestoreLastPosition = value;
}
}
public PlaybackBox()
{
InitializeComponent();
_programmaticallyChangingSeekBox = true;
_programmaticallyChangingValue = true;
if (Global.Config != null) // A check needed for the designer
{
TurboSeekCheckbox.Checked = Global.Config.TurboSeek;
AutoRestoreCheckbox.Checked = Global.Config.TAStudioAutoRestoreLastPosition;
}
_programmaticallyChangingSeekBox = false;
_programmaticallyChangingValue = false;
}
private void PreviousMarkerButton_Click(object sender, EventArgs e)
@ -69,10 +84,18 @@ namespace BizHawk.Client.EmuHawk
private void TurboSeekCheckbox_CheckedChanged(object sender, EventArgs e)
{
if (!_programmaticallyChangingSeekBox)
if (!_programmaticallyChangingValue)
{
Global.Config.TurboSeek ^= true;
}
}
private void AutoRestoreCheckbox_CheckedChanged(object sender, EventArgs e)
{
if (!_programmaticallyChangingValue)
{
Global.Config.TAStudioAutoRestoreLastPosition ^= true;
}
}
}
}