Merge pull request #2 from AdamSturge/feature/basic-bot-comparison-values

Feature/basic bot comparison values
This commit is contained in:
AdamSturge 2016-01-17 18:03:35 -08:00
commit f60bac62b0
2 changed files with 1334 additions and 861 deletions

View File

@ -76,25 +76,41 @@
this.AttemptsLabel = new System.Windows.Forms.Label(); this.AttemptsLabel = new System.Windows.Forms.Label();
this.FramesLabel = new System.Windows.Forms.Label(); this.FramesLabel = new System.Windows.Forms.Label();
this.GoalGroupBox = new System.Windows.Forms.GroupBox(); this.GoalGroupBox = new System.Windows.Forms.GroupBox();
this.panel6 = new System.Windows.Forms.Panel();
this.Tiebreak3Operator = new System.Windows.Forms.ComboBox(); this.Tiebreak3Operator = new System.Windows.Forms.ComboBox();
this.Tiebreak2Operator = new System.Windows.Forms.ComboBox();
this.Tiebreak1Operator = new System.Windows.Forms.ComboBox();
this.mainOperator = new System.Windows.Forms.ComboBox();
this.label12 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.TieBreaker1Box = new BizHawk.Client.EmuHawk.HexTextBox();
this.TieBreaker2Box = new BizHawk.Client.EmuHawk.HexTextBox();
this.TieBreaker3Box = new BizHawk.Client.EmuHawk.HexTextBox(); this.TieBreaker3Box = new BizHawk.Client.EmuHawk.HexTextBox();
this.label5 = new System.Windows.Forms.Label(); this.TieBreak3Numeric = new System.Windows.Forms.NumericUpDown();
this.MaximizeAddressBox = new BizHawk.Client.EmuHawk.HexTextBox(); this.TieBreak3ValueRadio = new System.Windows.Forms.RadioButton();
this.maximizeLabeltext = new System.Windows.Forms.Label(); this.TieBreak3BestRadio = new System.Windows.Forms.RadioButton();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.FrameLengthNumeric = new System.Windows.Forms.NumericUpDown(); this.FrameLengthNumeric = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.panel3 = new System.Windows.Forms.Panel();
this.MainValueNumeric = new System.Windows.Forms.NumericUpDown();
this.MainValueRadio = new System.Windows.Forms.RadioButton();
this.MainBestRadio = new System.Windows.Forms.RadioButton();
this.MainOperator = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
this.MaximizeAddressBox = new BizHawk.Client.EmuHawk.HexTextBox();
this.maximizeLabeltext = new System.Windows.Forms.Label();
this.panel4 = new System.Windows.Forms.Panel();
this.TieBreak1Numeric = new System.Windows.Forms.NumericUpDown();
this.TieBreak1ValueRadio = new System.Windows.Forms.RadioButton();
this.Tiebreak1Operator = new System.Windows.Forms.ComboBox();
this.TieBreak1BestRadio = new System.Windows.Forms.RadioButton();
this.label5 = new System.Windows.Forms.Label();
this.TieBreaker1Box = new BizHawk.Client.EmuHawk.HexTextBox();
this.label10 = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.TieBreak2Numeric = new System.Windows.Forms.NumericUpDown();
this.Tiebreak2Operator = new System.Windows.Forms.ComboBox();
this.TieBreak2ValueRadio = new System.Windows.Forms.RadioButton();
this.TieBreak2BestRadio = new System.Windows.Forms.RadioButton();
this.label11 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.TieBreaker2Box = new BizHawk.Client.EmuHawk.HexTextBox();
this.StopBtn = new System.Windows.Forms.Button(); this.StopBtn = new System.Windows.Forms.Button();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.StartFromSlotBox = new System.Windows.Forms.ComboBox(); this.StartFromSlotBox = new System.Windows.Forms.ComboBox();
@ -108,7 +124,15 @@
this.BestGroupBox.SuspendLayout(); this.BestGroupBox.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.GoalGroupBox.SuspendLayout(); this.GoalGroupBox.SuspendLayout();
this.panel6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.TieBreak3Numeric)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.FrameLengthNumeric)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.FrameLengthNumeric)).BeginInit();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.MainValueNumeric)).BeginInit();
this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.TieBreak1Numeric)).BeginInit();
this.panel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.TieBreak2Numeric)).BeginInit();
this.ControlGroupBox.SuspendLayout(); this.ControlGroupBox.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.StatsContextMenu.SuspendLayout(); this.StatsContextMenu.SuspendLayout();
@ -122,7 +146,7 @@
this.OptionsSubMenu}); this.OptionsSubMenu});
this.BotMenu.Location = new System.Drawing.Point(0, 0); this.BotMenu.Location = new System.Drawing.Point(0, 0);
this.BotMenu.Name = "BotMenu"; this.BotMenu.Name = "BotMenu";
this.BotMenu.Size = new System.Drawing.Size(587, 24); this.BotMenu.Size = new System.Drawing.Size(842, 24);
this.BotMenu.TabIndex = 0; this.BotMenu.TabIndex = 0;
this.BotMenu.Text = "menuStrip1"; this.BotMenu.Text = "menuStrip1";
// //
@ -302,7 +326,7 @@
this.MessageLabel}); this.MessageLabel});
this.BotStatusStrip.Location = new System.Drawing.Point(0, 565); this.BotStatusStrip.Location = new System.Drawing.Point(0, 565);
this.BotStatusStrip.Name = "BotStatusStrip"; this.BotStatusStrip.Name = "BotStatusStrip";
this.BotStatusStrip.Size = new System.Drawing.Size(587, 22); this.BotStatusStrip.Size = new System.Drawing.Size(842, 22);
this.BotStatusStrip.TabIndex = 2; this.BotStatusStrip.TabIndex = 2;
this.BotStatusStrip.Text = "statusStrip1"; this.BotStatusStrip.Text = "statusStrip1";
// //
@ -331,7 +355,7 @@
this.ControlsBox.Controls.Add(this.ControlProbabilityPanel); this.ControlsBox.Controls.Add(this.ControlProbabilityPanel);
this.ControlsBox.Location = new System.Drawing.Point(12, 183); this.ControlsBox.Location = new System.Drawing.Point(12, 183);
this.ControlsBox.Name = "ControlsBox"; this.ControlsBox.Name = "ControlsBox";
this.ControlsBox.Size = new System.Drawing.Size(312, 369); this.ControlsBox.Size = new System.Drawing.Size(567, 369);
this.ControlsBox.TabIndex = 3; this.ControlsBox.TabIndex = 3;
this.ControlsBox.TabStop = false; this.ControlsBox.TabStop = false;
this.ControlsBox.Text = "Controls"; this.ControlsBox.Text = "Controls";
@ -344,7 +368,7 @@
this.ControlProbabilityPanel.AutoScroll = true; this.ControlProbabilityPanel.AutoScroll = true;
this.ControlProbabilityPanel.Location = new System.Drawing.Point(6, 19); this.ControlProbabilityPanel.Location = new System.Drawing.Point(6, 19);
this.ControlProbabilityPanel.Name = "ControlProbabilityPanel"; this.ControlProbabilityPanel.Name = "ControlProbabilityPanel";
this.ControlProbabilityPanel.Size = new System.Drawing.Size(299, 344); this.ControlProbabilityPanel.Size = new System.Drawing.Size(554, 344);
this.ControlProbabilityPanel.TabIndex = 0; this.ControlProbabilityPanel.TabIndex = 0;
// //
// BestGroupBox // BestGroupBox
@ -364,7 +388,7 @@
this.BestGroupBox.Controls.Add(this.label15); this.BestGroupBox.Controls.Add(this.label15);
this.BestGroupBox.Controls.Add(this.label14); this.BestGroupBox.Controls.Add(this.label14);
this.BestGroupBox.Controls.Add(this.label13); this.BestGroupBox.Controls.Add(this.label13);
this.BestGroupBox.Location = new System.Drawing.Point(330, 183); this.BestGroupBox.Location = new System.Drawing.Point(585, 183);
this.BestGroupBox.Name = "BestGroupBox"; this.BestGroupBox.Name = "BestGroupBox";
this.BestGroupBox.Size = new System.Drawing.Size(245, 369); this.BestGroupBox.Size = new System.Drawing.Size(245, 369);
this.BestGroupBox.TabIndex = 4; this.BestGroupBox.TabIndex = 4;
@ -514,7 +538,7 @@
this.label13.AutoSize = true; this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(119, 16); this.label13.Location = new System.Drawing.Point(119, 16);
this.label13.Name = "label13"; this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(53, 13); this.label13.Size = new System.Drawing.Size(63, 13);
this.label13.TabIndex = 0; this.label13.TabIndex = 0;
this.label13.Text = "Main Value:"; this.label13.Text = "Main Value:";
// //
@ -558,32 +582,34 @@
// //
this.GoalGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.GoalGroupBox.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.GoalGroupBox.Controls.Add(this.Tiebreak3Operator); this.GoalGroupBox.Controls.Add(this.panel6);
this.GoalGroupBox.Controls.Add(this.Tiebreak2Operator);
this.GoalGroupBox.Controls.Add(this.Tiebreak1Operator);
this.GoalGroupBox.Controls.Add(this.mainOperator);
this.GoalGroupBox.Controls.Add(this.label12);
this.GoalGroupBox.Controls.Add(this.label11);
this.GoalGroupBox.Controls.Add(this.label10);
this.GoalGroupBox.Controls.Add(this.label9);
this.GoalGroupBox.Controls.Add(this.label7);
this.GoalGroupBox.Controls.Add(this.label6);
this.GoalGroupBox.Controls.Add(this.TieBreaker1Box);
this.GoalGroupBox.Controls.Add(this.TieBreaker2Box);
this.GoalGroupBox.Controls.Add(this.TieBreaker3Box);
this.GoalGroupBox.Controls.Add(this.label5);
this.GoalGroupBox.Controls.Add(this.MaximizeAddressBox);
this.GoalGroupBox.Controls.Add(this.maximizeLabeltext);
this.GoalGroupBox.Controls.Add(this.label4); this.GoalGroupBox.Controls.Add(this.label4);
this.GoalGroupBox.Controls.Add(this.FrameLengthNumeric); this.GoalGroupBox.Controls.Add(this.FrameLengthNumeric);
this.GoalGroupBox.Controls.Add(this.label3); this.GoalGroupBox.Controls.Add(this.label3);
this.GoalGroupBox.Controls.Add(this.panel3);
this.GoalGroupBox.Controls.Add(this.panel4);
this.GoalGroupBox.Controls.Add(this.panel5);
this.GoalGroupBox.Location = new System.Drawing.Point(12, 27); this.GoalGroupBox.Location = new System.Drawing.Point(12, 27);
this.GoalGroupBox.Name = "GoalGroupBox"; this.GoalGroupBox.Name = "GoalGroupBox";
this.GoalGroupBox.Size = new System.Drawing.Size(312, 150); this.GoalGroupBox.Size = new System.Drawing.Size(567, 150);
this.GoalGroupBox.TabIndex = 9; this.GoalGroupBox.TabIndex = 9;
this.GoalGroupBox.TabStop = false; this.GoalGroupBox.TabStop = false;
this.GoalGroupBox.Text = " "; this.GoalGroupBox.Text = " ";
// //
// panel6
//
this.panel6.Controls.Add(this.Tiebreak3Operator);
this.panel6.Controls.Add(this.label12);
this.panel6.Controls.Add(this.label7);
this.panel6.Controls.Add(this.TieBreaker3Box);
this.panel6.Controls.Add(this.TieBreak3Numeric);
this.panel6.Controls.Add(this.TieBreak3ValueRadio);
this.panel6.Controls.Add(this.TieBreak3BestRadio);
this.panel6.Location = new System.Drawing.Point(9, 120);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(546, 26);
this.panel6.TabIndex = 3;
//
// Tiebreak3Operator // Tiebreak3Operator
// //
this.Tiebreak3Operator.FormattingEnabled = true; this.Tiebreak3Operator.FormattingEnabled = true;
@ -593,173 +619,82 @@
"=", "=",
"<=", "<=",
"<"}); "<"});
this.Tiebreak3Operator.Location = new System.Drawing.Point(266, 119); this.Tiebreak3Operator.Location = new System.Drawing.Point(262, 3);
this.Tiebreak3Operator.Name = "Tiebreak3Operator"; this.Tiebreak3Operator.Name = "Tiebreak3Operator";
this.Tiebreak3Operator.Size = new System.Drawing.Size(40, 21); this.Tiebreak3Operator.Size = new System.Drawing.Size(40, 21);
this.Tiebreak3Operator.TabIndex = 1009; this.Tiebreak3Operator.TabIndex = 1017;
Tiebreak3Operator.SelectedIndex = 0;
//
// Tiebreak2Operator
//
this.Tiebreak2Operator.FormattingEnabled = true;
this.Tiebreak2Operator.Items.AddRange(new object[] {
">",
">=",
"=",
"<=",
"<"});
this.Tiebreak2Operator.Location = new System.Drawing.Point(266, 98);
this.Tiebreak2Operator.Name = "Tiebreak2Operator";
this.Tiebreak2Operator.Size = new System.Drawing.Size(40, 21);
this.Tiebreak2Operator.TabIndex = 1008;
Tiebreak2Operator.SelectedIndex = 0;
//
// Tiebreak1Operator
//
this.Tiebreak1Operator.FormattingEnabled = true;
this.Tiebreak1Operator.Items.AddRange(new object[] {
">",
">=",
"=",
"<=",
"<"});
this.Tiebreak1Operator.Location = new System.Drawing.Point(266, 76);
this.Tiebreak1Operator.Name = "Tiebreak1Operator";
this.Tiebreak1Operator.Size = new System.Drawing.Size(40, 21);
this.Tiebreak1Operator.TabIndex = 1007;
Tiebreak1Operator.SelectedIndex = 0;
//
// mainOperator
//
this.mainOperator.FormattingEnabled = true;
this.mainOperator.Items.AddRange(new object[] {
">",
">=",
"=",
"<=",
"<"});
this.mainOperator.Location = new System.Drawing.Point(266, 54);
this.mainOperator.Name = "mainOperator";
this.mainOperator.Size = new System.Drawing.Size(40, 21);
this.mainOperator.TabIndex = 1006;
mainOperator.SelectedIndex = 0;
// //
// label12 // label12
// //
this.label12.AutoSize = true; this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(74, 122); this.label12.Location = new System.Drawing.Point(67, 7);
this.label12.Name = "label12"; this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(59, 13); this.label12.Size = new System.Drawing.Size(59, 13);
this.label12.TabIndex = 14; this.label12.TabIndex = 1015;
this.label12.Text = "Address 0x"; this.label12.Text = "Address 0x";
// //
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(73, 101);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(59, 13);
this.label11.TabIndex = 13;
this.label11.Text = "Address 0x";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(73, 79);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(59, 13);
this.label10.TabIndex = 12;
this.label10.Text = "Address 0x";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(73, 57);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(59, 13);
this.label9.TabIndex = 11;
this.label9.Text = "Address 0x";
//
// label7 // label7
// //
this.label7.AutoSize = true; this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(6, 122); this.label7.Location = new System.Drawing.Point(1, 7);
this.label7.Name = "label7"; this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(61, 13); this.label7.Size = new System.Drawing.Size(61, 13);
this.label7.TabIndex = 10; this.label7.TabIndex = 1014;
this.label7.Text = "Tiebreak 3:"; this.label7.Text = "Tiebreak 3:";
// //
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 101);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(61, 13);
this.label6.TabIndex = 9;
this.label6.Text = "Tiebreak 2:";
//
// TieBreaker1Box
//
this.TieBreaker1Box.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TieBreaker1Box.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.TieBreaker1Box.Location = new System.Drawing.Point(139, 76);
this.TieBreaker1Box.Name = "TieBreaker1Box";
this.TieBreaker1Box.Nullable = true;
this.TieBreaker1Box.Size = new System.Drawing.Size(121, 20);
this.TieBreaker1Box.TabIndex = 1002;
//
// TieBreaker2Box
//
this.TieBreaker2Box.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TieBreaker2Box.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.TieBreaker2Box.Location = new System.Drawing.Point(139, 98);
this.TieBreaker2Box.Name = "TieBreaker2Box";
this.TieBreaker2Box.Nullable = true;
this.TieBreaker2Box.Size = new System.Drawing.Size(121, 20);
this.TieBreaker2Box.TabIndex = 1003;
//
// TieBreaker3Box // TieBreaker3Box
// //
this.TieBreaker3Box.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.TieBreaker3Box.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.TieBreaker3Box.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; this.TieBreaker3Box.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.TieBreaker3Box.Location = new System.Drawing.Point(139, 119); this.TieBreaker3Box.Location = new System.Drawing.Point(133, 4);
this.TieBreaker3Box.Name = "TieBreaker3Box"; this.TieBreaker3Box.Name = "TieBreaker3Box";
this.TieBreaker3Box.Nullable = true; this.TieBreaker3Box.Nullable = true;
this.TieBreaker3Box.Size = new System.Drawing.Size(121, 20); this.TieBreaker3Box.Size = new System.Drawing.Size(123, 20);
this.TieBreaker3Box.TabIndex = 1004; this.TieBreaker3Box.TabIndex = 1016;
// //
// label5 // TieBreak3Numeric
// //
this.label5.AutoSize = true; this.TieBreak3Numeric.Enabled = false;
this.label5.Location = new System.Drawing.Point(7, 79); this.TieBreak3Numeric.Location = new System.Drawing.Point(417, 4);
this.label5.Name = "label5"; this.TieBreak3Numeric.Maximum = new decimal(new int[] {
this.label5.Size = new System.Drawing.Size(61, 13); 100000,
this.label5.TabIndex = 5; 0,
this.label5.Text = "Tiebreak 1:"; 0,
0});
this.TieBreak3Numeric.Minimum = new decimal(new int[] {
100000,
0,
0,
-2147483648});
this.TieBreak3Numeric.Name = "TieBreak3Numeric";
this.TieBreak3Numeric.Size = new System.Drawing.Size(120, 20);
this.TieBreak3Numeric.TabIndex = 1013;
this.TieBreak3Numeric.ValueChanged += new System.EventHandler(this.TieBreak3Numeric_ValueChanged);
// //
// MaximizeAddressBox // TieBreak3ValueRadio
// //
this.MaximizeAddressBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.TieBreak3ValueRadio.AutoSize = true;
| System.Windows.Forms.AnchorStyles.Right))); this.TieBreak3ValueRadio.Location = new System.Drawing.Point(359, 6);
this.MaximizeAddressBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; this.TieBreak3ValueRadio.Name = "TieBreak3ValueRadio";
this.MaximizeAddressBox.Location = new System.Drawing.Point(139, 54); this.TieBreak3ValueRadio.Size = new System.Drawing.Size(52, 17);
this.MaximizeAddressBox.Name = "MaximizeAddressBox"; this.TieBreak3ValueRadio.TabIndex = 1012;
this.MaximizeAddressBox.Nullable = true; this.TieBreak3ValueRadio.Text = "Value";
this.MaximizeAddressBox.Size = new System.Drawing.Size(121, 20); this.TieBreak3ValueRadio.UseVisualStyleBackColor = true;
this.MaximizeAddressBox.TabIndex = 1001; this.TieBreak3ValueRadio.CheckedChanged += new System.EventHandler(this.TieBreak3ValueRadio_CheckedChanged);
this.MaximizeAddressBox.TextChanged += new System.EventHandler(this.FrameLengthNumeric_ValueChanged);
// //
// maximizeLabeltext // TieBreak3BestRadio
// //
this.maximizeLabeltext.AutoSize = true; this.TieBreak3BestRadio.AutoSize = true;
this.maximizeLabeltext.Location = new System.Drawing.Point(7, 57); this.TieBreak3BestRadio.Checked = true;
this.maximizeLabeltext.Name = "maximizeLabeltext"; this.TieBreak3BestRadio.Location = new System.Drawing.Point(307, 6);
this.maximizeLabeltext.Size = new System.Drawing.Size(63, 13); this.TieBreak3BestRadio.Name = "TieBreak3BestRadio";
this.maximizeLabeltext.TabIndex = 3; this.TieBreak3BestRadio.Size = new System.Drawing.Size(46, 17);
this.maximizeLabeltext.Text = "Main Value:"; this.TieBreak3BestRadio.TabIndex = 1011;
this.TieBreak3BestRadio.TabStop = true;
this.TieBreak3BestRadio.Text = "Best";
this.TieBreak3BestRadio.UseVisualStyleBackColor = true;
this.TieBreak3BestRadio.CheckedChanged += new System.EventHandler(this.Tiebreak3BestRadio_CheckedChanged);
// //
// label4 // label4
// //
@ -797,6 +732,306 @@
this.label3.TabIndex = 0; this.label3.TabIndex = 0;
this.label3.Text = "End after"; this.label3.Text = "End after";
// //
// panel3
//
this.panel3.Controls.Add(this.MainValueNumeric);
this.panel3.Controls.Add(this.MainValueRadio);
this.panel3.Controls.Add(this.MainBestRadio);
this.panel3.Controls.Add(this.MainOperator);
this.panel3.Controls.Add(this.label9);
this.panel3.Controls.Add(this.MaximizeAddressBox);
this.panel3.Controls.Add(this.maximizeLabeltext);
this.panel3.Location = new System.Drawing.Point(9, 51);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(546, 26);
this.panel3.TabIndex = 0;
//
// MainValueNumeric
//
this.MainValueNumeric.Enabled = false;
this.MainValueNumeric.Location = new System.Drawing.Point(417, 4);
this.MainValueNumeric.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.MainValueNumeric.Minimum = new decimal(new int[] {
100000,
0,
0,
-2147483648});
this.MainValueNumeric.Name = "MainValueNumeric";
this.MainValueNumeric.Size = new System.Drawing.Size(120, 20);
this.MainValueNumeric.TabIndex = 1013;
this.MainValueNumeric.ValueChanged += new System.EventHandler(this.MainValueNumeric_ValueChanged);
//
// MainValueRadio
//
this.MainValueRadio.AutoSize = true;
this.MainValueRadio.Location = new System.Drawing.Point(359, 6);
this.MainValueRadio.Name = "MainValueRadio";
this.MainValueRadio.Size = new System.Drawing.Size(52, 17);
this.MainValueRadio.TabIndex = 1012;
this.MainValueRadio.Text = "Value";
this.MainValueRadio.UseVisualStyleBackColor = true;
this.MainValueRadio.CheckedChanged += new System.EventHandler(this.MainValueRadio_CheckedChanged);
//
// MainBestRadio
//
this.MainBestRadio.AutoSize = true;
this.MainBestRadio.Checked = true;
this.MainBestRadio.Location = new System.Drawing.Point(307, 6);
this.MainBestRadio.Name = "MainBestRadio";
this.MainBestRadio.Size = new System.Drawing.Size(46, 17);
this.MainBestRadio.TabIndex = 1011;
this.MainBestRadio.TabStop = true;
this.MainBestRadio.Text = "Best";
this.MainBestRadio.UseVisualStyleBackColor = true;
this.MainBestRadio.CheckedChanged += new System.EventHandler(this.MainBestRadio_CheckedChanged);
//
// MainOperator
//
this.MainOperator.FormattingEnabled = true;
this.MainOperator.Items.AddRange(new object[] {
">",
">=",
"=",
"<=",
"<"});
this.MainOperator.Location = new System.Drawing.Point(262, 3);
this.MainOperator.Name = "MainOperator";
this.MainOperator.Size = new System.Drawing.Size(40, 21);
this.MainOperator.TabIndex = 1010;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(67, 7);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(59, 13);
this.label9.TabIndex = 1008;
this.label9.Text = "Address 0x";
//
// MaximizeAddressBox
//
this.MaximizeAddressBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.MaximizeAddressBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.MaximizeAddressBox.Location = new System.Drawing.Point(133, 4);
this.MaximizeAddressBox.Name = "MaximizeAddressBox";
this.MaximizeAddressBox.Nullable = true;
this.MaximizeAddressBox.Size = new System.Drawing.Size(123, 20);
this.MaximizeAddressBox.TabIndex = 1009;
//
// maximizeLabeltext
//
this.maximizeLabeltext.AutoSize = true;
this.maximizeLabeltext.Location = new System.Drawing.Point(1, 7);
this.maximizeLabeltext.Name = "maximizeLabeltext";
this.maximizeLabeltext.Size = new System.Drawing.Size(63, 13);
this.maximizeLabeltext.TabIndex = 1007;
this.maximizeLabeltext.Text = "Main Value:";
//
// panel4
//
this.panel4.Controls.Add(this.TieBreak1Numeric);
this.panel4.Controls.Add(this.TieBreak1ValueRadio);
this.panel4.Controls.Add(this.Tiebreak1Operator);
this.panel4.Controls.Add(this.TieBreak1BestRadio);
this.panel4.Controls.Add(this.label5);
this.panel4.Controls.Add(this.TieBreaker1Box);
this.panel4.Controls.Add(this.label10);
this.panel4.Location = new System.Drawing.Point(9, 74);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(546, 26);
this.panel4.TabIndex = 1;
//
// TieBreak1Numeric
//
this.TieBreak1Numeric.Enabled = false;
this.TieBreak1Numeric.Location = new System.Drawing.Point(417, 4);
this.TieBreak1Numeric.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.TieBreak1Numeric.Minimum = new decimal(new int[] {
100000,
0,
0,
-2147483648});
this.TieBreak1Numeric.Name = "TieBreak1Numeric";
this.TieBreak1Numeric.Size = new System.Drawing.Size(120, 20);
this.TieBreak1Numeric.TabIndex = 1013;
this.TieBreak1Numeric.ValueChanged += new System.EventHandler(this.TieBreak1Numeric_ValueChanged);
//
// TieBreak1ValueRadio
//
this.TieBreak1ValueRadio.AutoSize = true;
this.TieBreak1ValueRadio.Location = new System.Drawing.Point(359, 6);
this.TieBreak1ValueRadio.Name = "TieBreak1ValueRadio";
this.TieBreak1ValueRadio.Size = new System.Drawing.Size(52, 17);
this.TieBreak1ValueRadio.TabIndex = 1012;
this.TieBreak1ValueRadio.Text = "Value";
this.TieBreak1ValueRadio.UseVisualStyleBackColor = true;
this.TieBreak1ValueRadio.CheckedChanged += new System.EventHandler(this.TieBreak1ValueRadio_CheckedChanged);
//
// Tiebreak1Operator
//
this.Tiebreak1Operator.FormattingEnabled = true;
this.Tiebreak1Operator.Items.AddRange(new object[] {
">",
">=",
"=",
"<=",
"<"});
this.Tiebreak1Operator.Location = new System.Drawing.Point(262, 3);
this.Tiebreak1Operator.Name = "Tiebreak1Operator";
this.Tiebreak1Operator.Size = new System.Drawing.Size(40, 21);
this.Tiebreak1Operator.TabIndex = 1007;
//
// TieBreak1BestRadio
//
this.TieBreak1BestRadio.AutoSize = true;
this.TieBreak1BestRadio.Checked = true;
this.TieBreak1BestRadio.Location = new System.Drawing.Point(307, 6);
this.TieBreak1BestRadio.Name = "TieBreak1BestRadio";
this.TieBreak1BestRadio.Size = new System.Drawing.Size(46, 17);
this.TieBreak1BestRadio.TabIndex = 1011;
this.TieBreak1BestRadio.TabStop = true;
this.TieBreak1BestRadio.Text = "Best";
this.TieBreak1BestRadio.UseVisualStyleBackColor = true;
this.TieBreak1BestRadio.CheckedChanged += new System.EventHandler(this.Tiebreak1BestRadio_CheckedChanged);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(1, 7);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(61, 13);
this.label5.TabIndex = 5;
this.label5.Text = "Tiebreak 1:";
//
// TieBreaker1Box
//
this.TieBreaker1Box.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TieBreaker1Box.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.TieBreaker1Box.Location = new System.Drawing.Point(133, 4);
this.TieBreaker1Box.Name = "TieBreaker1Box";
this.TieBreaker1Box.Nullable = true;
this.TieBreaker1Box.Size = new System.Drawing.Size(123, 20);
this.TieBreaker1Box.TabIndex = 1002;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(67, 7);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(59, 13);
this.label10.TabIndex = 12;
this.label10.Text = "Address 0x";
//
// panel5
//
this.panel5.Controls.Add(this.TieBreak2Numeric);
this.panel5.Controls.Add(this.Tiebreak2Operator);
this.panel5.Controls.Add(this.TieBreak2ValueRadio);
this.panel5.Controls.Add(this.TieBreak2BestRadio);
this.panel5.Controls.Add(this.label11);
this.panel5.Controls.Add(this.label6);
this.panel5.Controls.Add(this.TieBreaker2Box);
this.panel5.Location = new System.Drawing.Point(9, 97);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(546, 26);
this.panel5.TabIndex = 2;
//
// TieBreak2Numeric
//
this.TieBreak2Numeric.Enabled = false;
this.TieBreak2Numeric.Location = new System.Drawing.Point(417, 4);
this.TieBreak2Numeric.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.TieBreak2Numeric.Minimum = new decimal(new int[] {
100000,
0,
0,
-2147483648});
this.TieBreak2Numeric.Name = "TieBreak2Numeric";
this.TieBreak2Numeric.Size = new System.Drawing.Size(120, 20);
this.TieBreak2Numeric.TabIndex = 1013;
this.TieBreak2Numeric.ValueChanged += new System.EventHandler(this.TieBreak2Numeric_ValueChanged);
//
// Tiebreak2Operator
//
this.Tiebreak2Operator.FormattingEnabled = true;
this.Tiebreak2Operator.Items.AddRange(new object[] {
">",
">=",
"=",
"<=",
"<"});
this.Tiebreak2Operator.Location = new System.Drawing.Point(262, 3);
this.Tiebreak2Operator.Name = "Tiebreak2Operator";
this.Tiebreak2Operator.Size = new System.Drawing.Size(40, 21);
this.Tiebreak2Operator.TabIndex = 1008;
//
// TieBreak2ValueRadio
//
this.TieBreak2ValueRadio.AutoSize = true;
this.TieBreak2ValueRadio.Location = new System.Drawing.Point(359, 6);
this.TieBreak2ValueRadio.Name = "TieBreak2ValueRadio";
this.TieBreak2ValueRadio.Size = new System.Drawing.Size(52, 17);
this.TieBreak2ValueRadio.TabIndex = 1012;
this.TieBreak2ValueRadio.Text = "Value";
this.TieBreak2ValueRadio.UseVisualStyleBackColor = true;
this.TieBreak2ValueRadio.CheckedChanged += new System.EventHandler(this.TieBreak2ValueRadio_CheckedChanged);
//
// TieBreak2BestRadio
//
this.TieBreak2BestRadio.AutoSize = true;
this.TieBreak2BestRadio.Checked = true;
this.TieBreak2BestRadio.Location = new System.Drawing.Point(307, 6);
this.TieBreak2BestRadio.Name = "TieBreak2BestRadio";
this.TieBreak2BestRadio.Size = new System.Drawing.Size(46, 17);
this.TieBreak2BestRadio.TabIndex = 1011;
this.TieBreak2BestRadio.TabStop = true;
this.TieBreak2BestRadio.Text = "Best";
this.TieBreak2BestRadio.UseVisualStyleBackColor = true;
this.TieBreak2BestRadio.CheckedChanged += new System.EventHandler(this.Tiebreak2BestRadio_CheckedChanged);
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(67, 7);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(59, 13);
this.label11.TabIndex = 13;
this.label11.Text = "Address 0x";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(1, 7);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(61, 13);
this.label6.TabIndex = 9;
this.label6.Text = "Tiebreak 2:";
//
// TieBreaker2Box
//
this.TieBreaker2Box.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TieBreaker2Box.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.TieBreaker2Box.Location = new System.Drawing.Point(133, 4);
this.TieBreaker2Box.Name = "TieBreaker2Box";
this.TieBreaker2Box.Nullable = true;
this.TieBreaker2Box.Size = new System.Drawing.Size(123, 20);
this.TieBreaker2Box.TabIndex = 1003;
//
// StopBtn // StopBtn
// //
this.StopBtn.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop; this.StopBtn.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop;
@ -847,7 +1082,7 @@
this.ControlGroupBox.Controls.Add(this.RunBtn); this.ControlGroupBox.Controls.Add(this.RunBtn);
this.ControlGroupBox.Controls.Add(this.StartFromSlotBox); this.ControlGroupBox.Controls.Add(this.StartFromSlotBox);
this.ControlGroupBox.Controls.Add(this.label8); this.ControlGroupBox.Controls.Add(this.label8);
this.ControlGroupBox.Location = new System.Drawing.Point(329, 27); this.ControlGroupBox.Location = new System.Drawing.Point(584, 27);
this.ControlGroupBox.Name = "ControlGroupBox"; this.ControlGroupBox.Name = "ControlGroupBox";
this.ControlGroupBox.Size = new System.Drawing.Size(245, 150); this.ControlGroupBox.Size = new System.Drawing.Size(245, 150);
this.ControlGroupBox.TabIndex = 2004; this.ControlGroupBox.TabIndex = 2004;
@ -884,7 +1119,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(587, 587); this.ClientSize = new System.Drawing.Size(842, 587);
this.Controls.Add(this.ControlGroupBox); this.Controls.Add(this.ControlGroupBox);
this.Controls.Add(this.GoalGroupBox); this.Controls.Add(this.GoalGroupBox);
this.Controls.Add(this.BestGroupBox); this.Controls.Add(this.BestGroupBox);
@ -908,7 +1143,19 @@
this.panel1.PerformLayout(); this.panel1.PerformLayout();
this.GoalGroupBox.ResumeLayout(false); this.GoalGroupBox.ResumeLayout(false);
this.GoalGroupBox.PerformLayout(); this.GoalGroupBox.PerformLayout();
this.panel6.ResumeLayout(false);
this.panel6.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.TieBreak3Numeric)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.FrameLengthNumeric)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.FrameLengthNumeric)).EndInit();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.MainValueNumeric)).EndInit();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.TieBreak1Numeric)).EndInit();
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.TieBreak2Numeric)).EndInit();
this.ControlGroupBox.ResumeLayout(false); this.ControlGroupBox.ResumeLayout(false);
this.ControlGroupBox.PerformLayout(); this.ControlGroupBox.PerformLayout();
this.panel2.ResumeLayout(false); this.panel2.ResumeLayout(false);
@ -939,24 +1186,18 @@
private System.Windows.Forms.Label FramesLabel; private System.Windows.Forms.Label FramesLabel;
private System.Windows.Forms.ToolStripMenuItem OptionsSubMenu; private System.Windows.Forms.ToolStripMenuItem OptionsSubMenu;
private System.Windows.Forms.GroupBox GoalGroupBox; private System.Windows.Forms.GroupBox GoalGroupBox;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private HexTextBox TieBreaker1Box; private HexTextBox TieBreaker1Box;
private HexTextBox TieBreaker2Box; private HexTextBox TieBreaker2Box;
private HexTextBox TieBreaker3Box;
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private HexTextBox MaximizeAddressBox;
private System.Windows.Forms.Label maximizeLabeltext;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.NumericUpDown FrameLengthNumeric; private System.Windows.Forms.NumericUpDown FrameLengthNumeric;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button StopBtn; private System.Windows.Forms.Button StopBtn;
private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label8;
private System.Windows.Forms.ComboBox StartFromSlotBox; private System.Windows.Forms.ComboBox StartFromSlotBox;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox BestTieBreak3Box; private System.Windows.Forms.TextBox BestTieBreak3Box;
private System.Windows.Forms.TextBox BestTieBreak2Box; private System.Windows.Forms.TextBox BestTieBreak2Box;
private System.Windows.Forms.TextBox BestTieBreak1Box; private System.Windows.Forms.TextBox BestTieBreak1Box;
@ -989,9 +1230,31 @@
private System.Windows.Forms.ToolStripMenuItem _1ByteMenuItem; private System.Windows.Forms.ToolStripMenuItem _1ByteMenuItem;
private System.Windows.Forms.ToolStripMenuItem _2ByteMenuItem; private System.Windows.Forms.ToolStripMenuItem _2ByteMenuItem;
private System.Windows.Forms.ToolStripMenuItem _4ByteMenuItem; private System.Windows.Forms.ToolStripMenuItem _4ByteMenuItem;
private System.Windows.Forms.ComboBox Tiebreak3Operator;
private System.Windows.Forms.ComboBox Tiebreak2Operator; private System.Windows.Forms.ComboBox Tiebreak2Operator;
private System.Windows.Forms.ComboBox Tiebreak1Operator; private System.Windows.Forms.ComboBox Tiebreak1Operator;
private System.Windows.Forms.ComboBox mainOperator; private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.ComboBox Tiebreak3Operator;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label7;
private HexTextBox TieBreaker3Box;
private System.Windows.Forms.NumericUpDown TieBreak3Numeric;
private System.Windows.Forms.RadioButton TieBreak3ValueRadio;
private System.Windows.Forms.RadioButton TieBreak3BestRadio;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.NumericUpDown TieBreak2Numeric;
private System.Windows.Forms.RadioButton TieBreak2ValueRadio;
private System.Windows.Forms.RadioButton TieBreak2BestRadio;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.NumericUpDown TieBreak1Numeric;
private System.Windows.Forms.RadioButton TieBreak1ValueRadio;
private System.Windows.Forms.RadioButton TieBreak1BestRadio;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.NumericUpDown MainValueNumeric;
private System.Windows.Forms.RadioButton MainValueRadio;
private System.Windows.Forms.RadioButton MainBestRadio;
private System.Windows.Forms.ComboBox MainOperator;
private System.Windows.Forms.Label label9;
private HexTextBox MaximizeAddressBox;
private System.Windows.Forms.Label maximizeLabeltext;
} }
} }

View File

@ -44,6 +44,7 @@ namespace BizHawk.Client.EmuHawk
private bool _oldCountingSetting = false; private bool _oldCountingSetting = false;
private BotAttempt _currentBotAttempt = null; private BotAttempt _currentBotAttempt = null;
private BotAttempt _bestBotAttempt = null; private BotAttempt _bestBotAttempt = null;
private BotAttempt _comparisonBotAttempt = null;
private bool _replayMode = false; private bool _replayMode = false;
private int _startFrame = 0; private int _startFrame = 0;
private string _lastRom = string.Empty; private string _lastRom = string.Empty;
@ -93,6 +94,8 @@ namespace BizHawk.Client.EmuHawk
InitializeComponent(); InitializeComponent();
Text = DialogTitle; Text = DialogTitle;
Settings = new BasicBotSettings(); Settings = new BasicBotSettings();
_comparisonBotAttempt = new BotAttempt();
} }
private void BasicBot_Load(object sender, EventArgs e) private void BasicBot_Load(object sender, EventArgs e)
@ -288,12 +291,12 @@ namespace BizHawk.Client.EmuHawk
{ {
get get
{ {
return (byte)mainOperator.SelectedIndex; return (byte)MainOperator.SelectedIndex;
} }
set set
{ {
if (value < 5) mainOperator.SelectedIndex = value; if (value < 5) MainOperator.SelectedIndex = value;
else mainOperator.SelectedIndex = 0; else MainOperator.SelectedIndex = 0;
} }
} }
@ -444,12 +447,21 @@ namespace BizHawk.Client.EmuHawk
TieBreaker2Address = 0; TieBreaker2Address = 0;
TieBreaker3Address = 0; TieBreaker3Address = 0;
StartFromSlotBox.SelectedIndex = 0; StartFromSlotBox.SelectedIndex = 0;
mainOperator.SelectedIndex = 0; MainOperator.SelectedIndex = 0;
Tiebreak1Operator.SelectedIndex = 0; Tiebreak1Operator.SelectedIndex = 0;
Tiebreak2Operator.SelectedIndex = 0; Tiebreak2Operator.SelectedIndex = 0;
Tiebreak3Operator.SelectedIndex = 0; Tiebreak3Operator.SelectedIndex = 0;
MainBestRadio.Checked = true;
MainValueNumeric.Value = 0;
TieBreak1Numeric.Value = 0;
TieBreak2Numeric.Value = 0;
TieBreak3Numeric.Value = 0;
TieBreak1BestRadio.Checked = true;
TieBreak2BestRadio.Checked = true;
TieBreak3BestRadio.Checked = true;
UpdateBestAttempt(); UpdateBestAttempt();
UpdateComparisonBotAttempt();
} }
private void OpenMenuItem_Click(object sender, EventArgs e) private void OpenMenuItem_Click(object sender, EventArgs e)
@ -562,6 +574,7 @@ namespace BizHawk.Client.EmuHawk
{ {
_bestBotAttempt = null; _bestBotAttempt = null;
UpdateBestAttempt(); UpdateBestAttempt();
UpdateComparisonBotAttempt();
} }
private void PlayBestButton_Click(object sender, EventArgs e) private void PlayBestButton_Click(object sender, EventArgs e)
@ -625,6 +638,14 @@ namespace BizHawk.Client.EmuHawk
public byte ComparisonTypeTie1 { get; set; } public byte ComparisonTypeTie1 { get; set; }
public byte ComparisonTypeTie2 { get; set; } public byte ComparisonTypeTie2 { get; set; }
public byte ComparisonTypeTie3 { get; set; } public byte ComparisonTypeTie3 { get; set; }
public bool MainCompareToBest { get; set; } = true;
public bool TieBreaker1CompareToBest { get; set; } = true;
public bool TieBreaker2CompareToBest { get; set; } = true;
public bool TieBreaker3CompareToBest { get; set; } = true;
public int MainCompareToValue { get; set; }
public int TieBreaker1CompareToValue { get; set; }
public int TieBreaker2CompareToValue { get; set; }
public int TieBreaker3CompareToValue { get; set; }
public int FrameLength { get; set; } public int FrameLength { get; set; }
public string FromSlot { get; set; } public string FromSlot { get; set; }
public long Attempts { get; set; } public long Attempts { get; set; }
@ -661,7 +682,6 @@ namespace BizHawk.Client.EmuHawk
_bestBotAttempt = botData.Best; _bestBotAttempt = botData.Best;
var probabilityControls = ControlProbabilityPanel.Controls var probabilityControls = ControlProbabilityPanel.Controls
.OfType<BotControlsRow>() .OfType<BotControlsRow>()
.ToList(); .ToList();
@ -682,6 +702,20 @@ namespace BizHawk.Client.EmuHawk
Tie1ComparisonType = botData.ComparisonTypeTie1; Tie1ComparisonType = botData.ComparisonTypeTie1;
Tie2ComparisonType = botData.ComparisonTypeTie2; Tie2ComparisonType = botData.ComparisonTypeTie2;
Tie3ComparisonType = botData.ComparisonTypeTie3; Tie3ComparisonType = botData.ComparisonTypeTie3;
MainBestRadio.Checked = botData.MainCompareToBest;
TieBreak1BestRadio.Checked = botData.TieBreaker1CompareToBest;
TieBreak2BestRadio.Checked = botData.TieBreaker2CompareToBest;
TieBreak3BestRadio.Checked = botData.TieBreaker3CompareToBest;
MainValueRadio.Checked = !botData.MainCompareToBest;
TieBreak1ValueRadio.Checked = !botData.TieBreaker1CompareToBest;
TieBreak2ValueRadio.Checked = !botData.TieBreaker2CompareToBest;
TieBreak3ValueRadio.Checked = !botData.TieBreaker3CompareToBest;
MainValueNumeric.Value = botData.MainCompareToValue;
TieBreak1Numeric.Value = botData.TieBreaker1CompareToValue;
TieBreak2Numeric.Value = botData.TieBreaker2CompareToValue;
TieBreak3Numeric.Value = botData.TieBreaker3CompareToValue;
} }
catch catch
{ {
@ -689,6 +723,20 @@ namespace BizHawk.Client.EmuHawk
Tie1ComparisonType = 0; Tie1ComparisonType = 0;
Tie2ComparisonType = 0; Tie2ComparisonType = 0;
Tie3ComparisonType = 0; Tie3ComparisonType = 0;
MainBestRadio.Checked = true;
TieBreak1BestRadio.Checked = true;
TieBreak2BestRadio.Checked = true;
TieBreak3BestRadio.Checked = true;
MainBestRadio.Checked = false;
TieBreak1BestRadio.Checked = false;
TieBreak2BestRadio.Checked = false;
TieBreak3BestRadio.Checked = false;
MainValueNumeric.Value = 0;
TieBreak1Numeric.Value = 0;
TieBreak2Numeric.Value = 0;
TieBreak3Numeric.Value = 0;
} }
FrameLength = botData.FrameLength; FrameLength = botData.FrameLength;
FromSlot = botData.FromSlot; FromSlot = botData.FromSlot;
@ -703,6 +751,7 @@ namespace BizHawk.Client.EmuHawk
_dataSize = botData.DataSize > 0 ? botData.DataSize : 1; _dataSize = botData.DataSize > 0 ? botData.DataSize : 1;
UpdateBestAttempt(); UpdateBestAttempt();
UpdateComparisonBotAttempt();
if (_bestBotAttempt != null) if (_bestBotAttempt != null)
{ {
@ -730,6 +779,14 @@ namespace BizHawk.Client.EmuHawk
ComparisonTypeTie1 = Tie1ComparisonType, ComparisonTypeTie1 = Tie1ComparisonType,
ComparisonTypeTie2 = Tie2ComparisonType, ComparisonTypeTie2 = Tie2ComparisonType,
ComparisonTypeTie3 = Tie3ComparisonType, ComparisonTypeTie3 = Tie3ComparisonType,
MainCompareToBest = MainBestRadio.Checked,
TieBreaker1CompareToBest = TieBreak1BestRadio.Checked,
TieBreaker2CompareToBest = TieBreak2BestRadio.Checked,
TieBreaker3CompareToBest = TieBreak3BestRadio.Checked,
MainCompareToValue = (int)MainValueNumeric.Value,
TieBreaker1CompareToValue = (int)TieBreak1Numeric.Value,
TieBreaker2CompareToValue = (int)TieBreak2Numeric.Value,
TieBreaker3CompareToValue = (int)TieBreak3Numeric.Value,
FromSlot = FromSlot, FromSlot = FromSlot,
FrameLength = FrameLength, FrameLength = FrameLength,
Attempts = Attempts, Attempts = Attempts,
@ -857,7 +914,7 @@ namespace BizHawk.Client.EmuHawk
_currentBotAttempt.TieBreak3 = TieBreaker3Value; _currentBotAttempt.TieBreak3 = TieBreaker3Value;
PlayBestButton.Enabled = true; PlayBestButton.Enabled = true;
if (_bestBotAttempt == null || IsBetter(_bestBotAttempt, _currentBotAttempt)) if (IsBetter(_comparisonBotAttempt, _currentBotAttempt))
{ {
_bestBotAttempt = _currentBotAttempt; _bestBotAttempt = _currentBotAttempt;
UpdateBestAttempt(); UpdateBestAttempt();
@ -880,25 +937,25 @@ namespace BizHawk.Client.EmuHawk
MessageLabel.Text = "Replay stopped"; MessageLabel.Text = "Replay stopped";
} }
private bool IsBetter(BotAttempt best, BotAttempt current) private bool IsBetter(BotAttempt comparison, BotAttempt current)
{ {
if (!TestValue(MainComparisonType, current.Maximize, best.Maximize)) if (!TestValue(MainComparisonType, current.Maximize, comparison.Maximize))
{ {
return false; return false;
} }
else if (current.Maximize == best.Maximize) else if (current.Maximize == comparison.Maximize)
{ {
if (!TestValue(Tie1ComparisonType, current.TieBreak1, best.TieBreak1)) if (!TestValue(Tie1ComparisonType, current.TieBreak1, comparison.TieBreak1))
{ {
return false; return false;
} }
else if (current.TieBreak1 == best.TieBreak1) else if (current.TieBreak1 == comparison.TieBreak1)
{ {
if (!TestValue(Tie2ComparisonType, current.TieBreak2, best.TieBreak2)) if (!TestValue(Tie2ComparisonType, current.TieBreak2, comparison.TieBreak2))
{ {
return false; return false;
} }
else if (current.TieBreak2 == best.TieBreak2) else if (current.TieBreak2 == comparison.TieBreak2)
{ {
if (!TestValue(Tie3ComparisonType, current.TieBreak3, current.TieBreak3)) if (!TestValue(Tie3ComparisonType, current.TieBreak3, current.TieBreak3))
{ {
@ -933,8 +990,6 @@ namespace BizHawk.Client.EmuHawk
{ {
if (_bestBotAttempt != null) if (_bestBotAttempt != null)
{ {
ClearBestButton.Enabled = true; ClearBestButton.Enabled = true;
BestAttemptNumberLabel.Text = _bestBotAttempt.Attempt.ToString(); BestAttemptNumberLabel.Text = _bestBotAttempt.Attempt.ToString();
BestMaximizeBox.Text = _bestBotAttempt.Maximize.ToString(); BestMaximizeBox.Text = _bestBotAttempt.Maximize.ToString();
@ -1101,5 +1156,160 @@ namespace BizHawk.Client.EmuHawk
&& !string.IsNullOrWhiteSpace(MaximizeAddressBox.Text) && !string.IsNullOrWhiteSpace(MaximizeAddressBox.Text)
&& ControlProbabilities.Any(kvp => kvp.Value > 0); && ControlProbabilities.Any(kvp => kvp.Value > 0);
} }
/// <summary>
/// Updates comparison bot attempt with current best bot attempt values for values where the "best" radio button is selected
/// </summary>
private void UpdateComparisonBotAttempt()
{
if(_bestBotAttempt == null)
{
if (MainBestRadio.Checked)
{
_comparisonBotAttempt.Maximize = 0;
}
if (TieBreak1BestRadio.Checked)
{
_comparisonBotAttempt.TieBreak1 = 0;
}
if (TieBreak2BestRadio.Checked)
{
_comparisonBotAttempt.TieBreak2= 0;
}
if (TieBreak3BestRadio.Checked)
{
_comparisonBotAttempt.TieBreak3 = 0;
}
}
else
{
if (MainBestRadio.Checked && _bestBotAttempt.Maximize != _comparisonBotAttempt.Maximize)
{
_comparisonBotAttempt.Maximize = _bestBotAttempt.Maximize;
}
if (TieBreak1BestRadio.Checked && _bestBotAttempt.TieBreak1 != _comparisonBotAttempt.TieBreak1)
{
_comparisonBotAttempt.TieBreak1 = _bestBotAttempt.TieBreak1;
}
if (TieBreak2BestRadio.Checked && _bestBotAttempt.TieBreak2 != _comparisonBotAttempt.TieBreak2)
{
_comparisonBotAttempt.TieBreak2 = _bestBotAttempt.TieBreak2;
}
if (TieBreak3BestRadio.Checked && _bestBotAttempt.TieBreak3 != _comparisonBotAttempt.TieBreak3)
{
_comparisonBotAttempt.TieBreak3 = _bestBotAttempt.TieBreak3;
}
}
}
private void MainBestRadio_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
if (radioButton.Checked)
{
this.MainValueNumeric.Enabled = false;
_comparisonBotAttempt.Maximize = _bestBotAttempt == null ? 0 : _bestBotAttempt.Maximize;
}
}
private void Tiebreak1BestRadio_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
if (radioButton.Checked)
{
this.TieBreak1Numeric.Enabled = false;
_comparisonBotAttempt.TieBreak1 = _bestBotAttempt == null ? 0 : _bestBotAttempt.TieBreak1;
}
}
private void Tiebreak2BestRadio_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
if (radioButton.Checked)
{
this.TieBreak2Numeric.Enabled = false;
_comparisonBotAttempt.TieBreak2 = _bestBotAttempt == null ? 0 : _bestBotAttempt.TieBreak2;
}
}
private void Tiebreak3BestRadio_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
if (radioButton.Checked)
{
this.TieBreak3Numeric.Enabled = false;
_comparisonBotAttempt.TieBreak3 = _bestBotAttempt == null ? 0 : _bestBotAttempt.TieBreak3;
}
}
private void MainValueRadio_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
if (radioButton.Checked)
{
this.MainValueNumeric.Enabled = true;
_comparisonBotAttempt.Maximize = (int)this.MainValueNumeric.Value;
}
}
private void TieBreak1ValueRadio_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
if (radioButton.Checked)
{
this.TieBreak1Numeric.Enabled = true;
_comparisonBotAttempt.TieBreak1 = (int)this.TieBreak1Numeric.Value;
}
}
private void TieBreak2ValueRadio_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
if (radioButton.Checked)
{
this.TieBreak2Numeric.Enabled = true;
_comparisonBotAttempt.TieBreak2 = (int)this.TieBreak2Numeric.Value;
}
}
private void TieBreak3ValueRadio_CheckedChanged(object sender, EventArgs e)
{
RadioButton radioButton = (RadioButton)sender;
if (radioButton.Checked)
{
this.TieBreak3Numeric.Enabled = true;
_comparisonBotAttempt.TieBreak3 = (int)this.TieBreak3Numeric.Value;
}
}
private void MainValueNumeric_ValueChanged(object sender, EventArgs e)
{
NumericUpDown numericUpDown = (NumericUpDown)sender;
this._comparisonBotAttempt.Maximize = (int)numericUpDown.Value;
}
private void TieBreak1Numeric_ValueChanged(object sender, EventArgs e)
{
NumericUpDown numericUpDown = (NumericUpDown)sender;
this._comparisonBotAttempt.TieBreak1 = (int)numericUpDown.Value;
}
private void TieBreak2Numeric_ValueChanged(object sender, EventArgs e)
{
NumericUpDown numericUpDown = (NumericUpDown)sender;
this._comparisonBotAttempt.TieBreak2 = (int)numericUpDown.Value;
}
private void TieBreak3Numeric_ValueChanged(object sender, EventArgs e)
{
NumericUpDown numericUpDown = (NumericUpDown)sender;
this._comparisonBotAttempt.TieBreak3 = (int)numericUpDown.Value;
}
} }
} }