private void Form1_Load(object sender, EventArgs e) { HeadRestriction.DataSource = loader.head.Gear; HeadRestriction.SelectedIndexChanged += HeadRestriction_SelectedIndexChanged; BodyRestriction.DataSource = loader.body.Gear; ArmRestriction.DataSource = loader.arms.Gear; LegRestriction.DataSource = loader.legs.Gear; OptimizeFor.DataSource = StatOptimize.Optimizer; MaxEquipLoad.KeyPress += Decimal_KeyPress; GearWeight.KeyPress += Decimal_KeyPress; RollBox.KeyPress += Decimal_KeyPress; RollBox.Validating += RollBox_TextChanged; armorSettings = new ArmorSettings() { head = new bool[loader.head.Gear.Count - 1], body = new bool[loader.body.Gear.Count - 1], arms = new bool[loader.arms.Gear.Count - 1], legs = new bool[loader.legs.Gear.Count - 1] }; resetArmor(); }
private void ArmorFiltering_Load(object sender, EventArgs e) { CheckPanel.AutoScroll = false; CheckPanel.HorizontalScroll.Enabled = false; CheckPanel.HorizontalScroll.Visible = false; CheckPanel.HorizontalScroll.Maximum = 0; CheckPanel.AutoScroll = true; // don't stomp over changes unless they are confirmed settings = ScholarArmorOptimizer.armorSettings; head = new CheckBox[settings.head.Length]; body = new CheckBox[settings.body.Length]; arms = new CheckBox[settings.arms.Length]; legs = new CheckBox[settings.legs.Length]; int width = CheckPanel.Width; int vertSpace = 20; Font font = new Font("Microsoft Sans Serif", 8.25F); for (int i = 0; i < head.Length; ++i) { head[i] = new CheckBox { Checked = settings.head[i], Visible = true, Parent = CheckPanel, Location = new Point(16, i * vertSpace), Text = ScholarArmorOptimizer.loader.head.Gear[i + 1].Name, Font = font, Size = new Size(width / 4 - 40, vertSpace - 3) }; } for (int i = 0; i < body.Length; ++i) { body[i] = new CheckBox { Checked = settings.body[i], Visible = true, Parent = CheckPanel, Location = new Point(16 + width / 4, i * vertSpace), Text = ScholarArmorOptimizer.loader.body.Gear[i + 1].Name, Font = font, Size = new Size(width / 4 - 40, vertSpace - 3) }; } for (int i = 0; i < arms.Length; ++i) { arms[i] = new CheckBox { Checked = settings.arms[i], Visible = true, Parent = CheckPanel, Location = new Point(16 + width / 2, i * vertSpace), Text = ScholarArmorOptimizer.loader.arms.Gear[i + 1].Name, Font = font, Size = new Size(width / 4 - 40, vertSpace - 3) }; } for (int i = 0; i < legs.Length; ++i) { legs[i] = new CheckBox { Checked = settings.legs[i], Visible = true, Parent = CheckPanel, Location = new Point(16 + 3 * width / 4, i * vertSpace), Text = ScholarArmorOptimizer.loader.legs.Gear[i + 1].Name, Font = font, Size = new Size(width / 4 - 40, vertSpace - 3) }; } }