private void Draw(object sender, PaintEventArgs e) { if (selectedSkill != null) { Graphics g = e.Graphics; //Point mousePos = this.PointToClient(Cursor.Position); Point mouseIndex = this.CursorToIndices(); int i; for (i = 0; i < selectedSkill.Techniques.Count; i++) { SkillTechnique tech = selectedSkill.Techniques[i]; DrawHelper(g, i, 0, techPen, regularText, tech.PartInfo.Name); //Point techPos = new Point(startPos.X + boxSize.Width * i, startPos.Y); //g.DrawRectangle(techPen, new Rectangle(techPos, boxSize)); //g.DrawString(tech.PartInfo.Name, null, Brushes.White, techPos); int j; for (j = 0; j < tech.Modifiers.Count; j++) { SkillModifier mod = tech.Modifiers[j]; DrawHelper(g, i, j + 1, modPen, regularText, mod.PartInfo.Name); //Point modPos = new Point(techPos.X, techPos.Y + boxSize.Height * (1 + j)); //g.DrawRectangle(modPen, new Rectangle(modPos, boxSize)); } DrawHelper(g, i, j + 1, emptyModPen, emptyText, "+NEW MOD"); //Point newModPos = new Point(techPos.X, techPos.Y + boxSize.Height * (1 + j)); //g.DrawRectangle(emptyPen, new Rectangle(newModPos, boxSize)); } DrawHelper(g, i, 0, emptyTechPen, emptyText, "+NEW TECH"); //Point newTechPos = new Point(startPos.X + boxSize.Width * i, startPos.Y); //g.DrawRectangle(emptyPen, new Rectangle(newTechPos, boxSize)); DrawHelper(g, mouseIndex.X, mouseIndex.Y, selectedPen, regularText, ""); } }
private void frmSkillCrafter_MouseClick(object sender, MouseEventArgs e) { if (selectedSkill != null) { Point mouseIndex = CursorToIndices(); SkillTechnique tech; if (mouseIndex.X < selectedSkill.Techniques.Count) { tech = selectedSkill.Techniques[mouseIndex.X]; if (mouseIndex.Y == 0) { SkillPartInfo info = frmSkillPicker.Show(this, GameData.Current.TechsInfo); if (info == null) { selectedSkill.Techniques.Remove(tech); } else { tech.PartInfo = info; } } else if (mouseIndex.Y <= tech.Modifiers.Count) { SkillModifier mod = tech.Modifiers[mouseIndex.Y - 1]; SkillPartInfo info = frmSkillPicker.Show(this, GameData.Current.ModsInfo); if (info == null) { tech.Modifiers.Remove(mod); } else { mod.PartInfo = info; } } else { SkillPartInfo info = frmSkillPicker.Show(this, GameData.Current.ModsInfo); if (info != null) { tech.Modifiers.Add(new SkillModifier(info, 1)); } } } else { SkillPartInfo info = frmSkillPicker.Show(this, GameData.Current.TechsInfo); if (info != null) { tech = new SkillTechnique((SkillTechniqueInfo)info, 1); selectedSkill.Techniques.Add(tech); } } //if (mouseIndex.Y == 0) //It's a technique //{ // if (mouseIndex.X < skill.Techniques.Count) // { // } // else // { // } //} //else //{ //} RefreshDescription(); } }