private void LoadData()
{
// Load data
_ucDemonbuddy.textBox1.Text = bot.Name;
_ucDemonbuddy.textBox2.Text = bot.Description;
// Advanced section
_ucAdvanced.checkBox2.Checked = bot.CreateWindowsUser;
_ucAdvanced.checkBox1.Checked = bot.UseWindowsUser;
_ucAdvanced.textBox1.Text = bot.WindowsUserName;
_ucAdvanced.maskedTextBox1.Text = bot.WindowsUserPassword;
_ucAdvanced.textBox3.Text = bot.D3PrefsLocation;
_ucAdvanced.checkBox3.Checked = bot.UseDiabloClone;
_ucAdvanced.textBox2.Text = bot.DiabloCloneLocation;
// Demonbuddy
_ucDemonbuddy.textBox4.Text = bot.Demonbuddy.Location;
_ucDemonbuddy.textBox3.Text = bot.Demonbuddy.Key;
_ucDemonbuddy.comboBox1.Text = bot.Demonbuddy.CombatRoutine;
_ucDemonbuddy.checkBox1.Checked = bot.Demonbuddy.NoFlash;
_ucDemonbuddy.checkBox2.Checked = bot.Demonbuddy.AutoUpdate;
_ucDemonbuddy.checkBox3.Checked = bot.Demonbuddy.NoUpdate;
_ucDemonbuddy.textBox9.Text = bot.Demonbuddy.BuddyAuthUsername;
_ucDemonbuddy.maskedTextBox2.Text = bot.Demonbuddy.BuddyAuthPassword;
_ucDemonbuddy.comboBox2.SelectedIndex = bot.Demonbuddy.Priority;
_ucDemonbuddy.checkBox5.Checked = bot.Demonbuddy.ForceEnableAllPlugins;
// Demonbuddy manual position
_ucDemonbuddy.checkBox4.Checked = bot.Demonbuddy.ManualPosSize;
_ucDemonbuddy.textBox6.Text = bot.Demonbuddy.X.ToString();
_ucDemonbuddy.textBox5.Text = bot.Demonbuddy.Y.ToString();
_ucDemonbuddy.textBox10.Text = bot.Demonbuddy.W.ToString();
_ucDemonbuddy.textBox11.Text = bot.Demonbuddy.H.ToString();
// Diablo
_ucDiablo.textBox3.Text = bot.Diablo.Username;
_ucDiablo.maskedTextBox1.Text = bot.Diablo.Password;
_ucDiablo.textBox1.Text = bot.Diablo.Location;
_ucDiablo.comboBox1.SelectedItem = bot.Diablo.Language;
_ucDiablo.comboBox2.SelectedItem = bot.Diablo.Region;
_ucDiablo.checkBox1.Checked = bot.Diablo.UseAuthenticator;
_ucDiablo.checkBox2.Checked = bot.Diablo.UseIsBoxer;
_ucDiablo.textBox13.Text = bot.Diablo.CharacterSet;
_ucDiablo.textBox12.Text = bot.Diablo.DisplaySlot;
_ucDiablo.checkBox4.Checked = bot.Diablo.NoFrame;
// Affinity Diablo
if (bot.Diablo.CpuCount != Environment.ProcessorCount)
{
bot.Diablo.ProcessorAffinity = bot.Diablo.AllProcessors;
bot.Diablo.CpuCount = Environment.ProcessorCount;
}
if (AffinityDiablo.cpus.Count != bot.Diablo.CpuCount)
{
Logger.Instance.Write("For whatever reason Diablo and UI see different number of CPUs, affinity disabled");
}
else
{
for (int i = 0; i < bot.Diablo.CpuCount; i++)
{
AffinityDiablo.cpus[i].Checked = ((bot.Diablo.ProcessorAffinity & (1 << i)) != 0);
}
}
// Affinity Demonbuddy
if (bot.Demonbuddy.CpuCount != Environment.ProcessorCount)
{
bot.Demonbuddy.ProcessorAffinity = bot.Demonbuddy.AllProcessors;
bot.Demonbuddy.CpuCount = Environment.ProcessorCount;
}
if (AffinityDemonbuddy.cpus.Count != bot.Demonbuddy.CpuCount)
{
Logger.Instance.Write("For whatever reason Demonbuddy and UI see different number of CPUs, affinity disabled");
}
else
{
for (int i = 0; i < bot.Demonbuddy.CpuCount; i++)
{
AffinityDemonbuddy.cpus[i].Checked = ((bot.Demonbuddy.ProcessorAffinity & (1 << i)) != 0);
}
}
//d.Serial = string.Format("{0}-{1}-{2}-{3}", ucDiablo.textBox4.Text, ucDiablo.textBox5.Text, ucDiablo.textBox7.Text, ucDiablo.textBox6.Text);
//ucDiablo.textBox8.Text = bot.diablo.RestoreCode;
_ucDiablo.comboBox3.SelectedIndex = bot.Diablo.Priority;
// Diablo manual position
_ucDiablo.checkBox3.Checked = bot.Diablo.ManualPosSize;
_ucDiablo.textBox2.Text = bot.Diablo.X.ToString();
_ucDiablo.textBox9.Text = bot.Diablo.Y.ToString();
_ucDiablo.textBox10.Text = bot.Diablo.W.ToString();
_ucDiablo.textBox11.Text = bot.Diablo.H.ToString();
// Profile Schedule
_ucProfileSchedule.Profiles = bot.ProfileSchedule.Profiles;
_ucProfileSchedule.textBox1.Text = bot.ProfileSchedule.MaxRandomTime.ToString();
_ucProfileSchedule.textBox2.Text = bot.ProfileSchedule.MaxRandomRuns.ToString();
_ucProfileSchedule.checkBox1.Checked = bot.ProfileSchedule.Random;
// Load Weekschedule
_ucWeekSchedule.textBox1.Text = bot.Week.MinRandom.ToString();
_ucWeekSchedule.textBox2.Text = bot.Week.MaxRandom.ToString();
_ucWeekSchedule.checkBox1.Checked = bot.Week.Shuffle;
_ucWeekSchedule.LoadSchedule(bot);
}