diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 9b3f2d25b8..41cd8dbd92 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -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(); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.Designer.cs index bd79409274..83f2726462 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.Designer.cs @@ -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 // diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs index 55adfcd0ff..6ef35335d8 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/PlaybackBox.cs @@ -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; + } + } } }