Added UI components for specifying comparision values. Added logic to control enabling them.

This commit is contained in:
Adam Sturge 2016-01-16 16:22:39 -08:00
parent e484eee95b
commit a7f24179cb
2 changed files with 1139 additions and 837 deletions

File diff suppressed because it is too large Load Diff

View File

@ -44,6 +44,7 @@ namespace BizHawk.Client.EmuHawk
private bool _oldCountingSetting = false;
private BotAttempt _currentBotAttempt = null;
private BotAttempt _bestBotAttempt = null;
private BotAttempt _comparisonBotAttempt = null;
private bool _replayMode = false;
private int _startFrame = 0;
private string _lastRom = string.Empty;
@ -93,7 +94,9 @@ namespace BizHawk.Client.EmuHawk
InitializeComponent();
Text = DialogTitle;
Settings = new BasicBotSettings();
}
_comparisonBotAttempt = new BotAttempt();
}
private void BasicBot_Load(object sender, EventArgs e)
{
@ -1101,5 +1104,85 @@ namespace BizHawk.Client.EmuHawk
&& !string.IsNullOrWhiteSpace(MaximizeAddressBox.Text)
&& ControlProbabilities.Any(kvp => kvp.Value > 0);
}
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;
}
}
}
}