From 6db5a01f540d9617fd042cb774bef0cf32806ae0 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 5 Sep 2015 23:47:27 -0400 Subject: [PATCH] Basic Bot - implement New menu item --- .../tools/BasicBot/BasicBot.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs b/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs index 0679451b36..18e8da12c5 100644 --- a/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs +++ b/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs @@ -342,7 +342,22 @@ namespace BizHawk.Client.EmuHawk private void NewMenuItem_Click(object sender, EventArgs e) { - MessageBox.Show("TODO"); + _currentFileName = string.Empty; + _bestBotAttempt = null; + + ControlProbabilityPanel.Controls + .OfType() + .ToList() + .ForEach(cp => cp.Probability = 0); + + FrameLength = 0; + MaximizeAddress = 0; + TieBreaker1Address = 0; + TieBreaker2Address = 0; + TieBreaker3Address = 0; + StartFromSlotBox.SelectedIndex = 0; + + UpdateBestAttempt(); } private void ExitMenuItem_Click(object sender, EventArgs e) @@ -571,6 +586,7 @@ namespace BizHawk.Client.EmuHawk sb.AppendLine(logEntry); } BestAttemptLogLabel.Text = sb.ToString(); + PlayBestButton.Enabled = true; } else { @@ -581,6 +597,7 @@ namespace BizHawk.Client.EmuHawk BestTieBreak2Box.Text = string.Empty; BestTieBreak3Box.Text = string.Empty; BestAttemptLogLabel.Text = string.Empty; + PlayBestButton.Enabled = false; } }