private void UpdateControls(CircleClickSettings settings) { this.circleX.Value = settings._circleX; this.circleY.Value = settings._circleY; this.minRadius.Value = settings._minRadius; this.maxRadius.Value = settings._maxRadius; this.pointDistance.Value = settings._pointDistance; this.roundDistance.Value = settings._roundDistance; this.timeInterval.Value = settings._timeInterval; this.chkBack.Checked = settings._back; this.chkClick.Checked = settings._simulateMouse; this.chkNoSkill.Checked = settings._noSkill; this.noSkillInterval.Value = settings._noSkillInterval; this.noSkillInterval.Enabled = settings._noSkill; this.chkHand.Checked = settings._hand; this.chkHandFirst.Checked = (settings._hand && settings._handFirst); this.runAwayXueYao.Value = settings._runAwayXueYao; this.runAwayLanYao.Value = settings._runAwayLanYao; }
private void FormMain_Load(object sender, EventArgs e) { this.lblState.Text = ""; if (File.Exists("xiayidao.dantiaoban.xml")) { XElement xCircleClickSettings = XElement.Load("xiayidao.dantiaoban.xml"); this._settings = CircleClickSettings.From(xCircleClickSettings); } if (this._settings == null) { this._settings = new CircleClickSettings(); } this.UpdateControls(this._settings); this._currentRadius = (double)this._settings._minRadius; this._angle = 0.0; EventHandler value = new EventHandler(this.circleX_ValueChanged); this.circleX.ValueChanged += value; this.circleY.ValueChanged += value; this.minRadius.ValueChanged += value; this.maxRadius.ValueChanged += value; this.pointDistance.ValueChanged += value; this.roundDistance.ValueChanged += value; this.timeInterval.ValueChanged += value; this.chkBack.CheckedChanged += value; this.runAwayXueYao.ValueChanged += value; this.runAwayLanYao.ValueChanged += value; this.chkHand.CheckedChanged += value; this.chkHandFirst.CheckedChanged += value; this.chkNoSkill.CheckedChanged += value; this.noSkillInterval.ValueChanged += value; this.chkClick.CheckedChanged += value; this._curImage = new Bitmap(this.picCursor.Width, this.picCursor.Height); int num = 0; int y = 0; int width = 5; int height = 10; int num2 = 32; for (int i = 0; i < this._killedOfNineRects.Length; i++) { this._killedOfNineRects[i] = new Rectangle(num, y, width, height); num += num2; } try { for (int j = 0; j < this._killedOfNineImages.Length; j++) { this._killedOfNineImages[j] = new Bitmap(Path.Combine(Application.StartupPath, "shazhen\\shazhen" + j.ToString() + ".bmp")); this._killedOfNineImageStreams[j] = new MemoryStream(); this._killedOfNineImages[j].Save(this._killedOfNineImageStreams[j], ImageFormat.Bmp); } } catch (Exception) { this.chkNoSkill.Checked = false; this.chkNoSkill.ForeColor = Color.Gray; this.noSkillInterval.Enabled = false; this.chkNoSkill.Click += new EventHandler(this.chkNoSkill_Click); } }