private void cboChoices_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboChoices.SelectedItem != null)
     {
         this.pickedPart = (SkillPartInfo)cboChoices.SelectedItem;
     }
     else
     {
         this.pickedPart = null;
     }
 }
Beispiel #2
0
        private void LoadPart(SkillPartInfo partInfo)
        {
            currentPartInfo = partInfo;

            txtId.Text           = partInfo.Id.ToString();
            txtName.Text         = partInfo.Name;
            txtDescription.Text  = partInfo.Description;
            txtDescription2.Text = partInfo.Description2;
            txtDescription3.Text = partInfo.Description3;
            numHPCost.Value      = (decimal)partInfo.Cost.health;
            numMPCost.Value      = (decimal)partInfo.Cost.mana;
            numSPCost.Value      = (decimal)partInfo.Cost.stamina;

            if (partInfo is SkillModifierInfo)
            {
                cboType.Items.Clear();
                foreach (SkillModifierInfo.ModifierType type in modTypes)
                {
                    cboType.Items.Add(type);
                }

                SkillModifierInfo modInfo = (SkillModifierInfo)partInfo;
                cboType.SelectedItem = modInfo.ModType;
            }
            else
            {
                cboType.Items.Clear();
                foreach (SkillTechniqueInfo.TechniqueType type in techTypes)
                {
                    cboType.Items.Add(type);
                }

                SkillTechniqueInfo techInfo = (SkillTechniqueInfo)partInfo;
                cboType.SelectedItem = techInfo.TechType;
            }
        }
Beispiel #3
0
        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();
            }
        }
 private void btnCancel_Click(object sender, EventArgs e)
 {
     this.pickedPart = null;
     this.Close();
 }