private void lstParts_SelectedIndexChanged(object sender, EventArgs e) { SaveCurrentPart(); if (lstParts.SelectedIndex < 0) { currentPartInfo = null; btnRemovePart.Hide(); grpPartInfo.Hide(); } else { btnRemovePart.Show(); grpPartInfo.Show(); LoadPart((SkillPartInfo)lstParts.SelectedItem); } }
private void btnAddPart_Click(object sender, EventArgs e) { SaveCurrentPart(); if (cboPartType.Text == PARTS_TYPE_MODIFER) { currentPartInfo = new SkillModifierInfo(); GameData.Current.ModsInfo.Add(currentPartInfo); } else //must be a technique { currentPartInfo = new SkillTechniqueInfo(); GameData.Current.TechsInfo.Add(currentPartInfo); } //SkillData.Current.PartsInfo.Add(currentPartInfo); LoadPart(currentPartInfo); lstParts.Items.Add(currentPartInfo); lstParts.SelectedIndex = lstParts.Items.Count - 1; }
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; } }
public SkillModifier(SkillPartInfo info, uint count) : base(info, count) { }
public SkillPart(SkillPartInfo info, uint count) { this.PartInfo = info; this.Count = count; }