public static MonHunEquip Create(byte[] equip) { MonHunEquip obj = null; byte tp = equip[0]; switch (tp) { case 6: obj = new MonHunTalisman(equip); break; default: obj = new MonHunEquip(equip); break; } return(obj); }
public void UpdateSelectedEquip(MonHunEquip obj) { _equipSelectionUpdating = true; comboBoxEquipType.DataSource = null; comboBoxEquipID.DataSource = null; _selEquip = obj; comboBoxEquipType.DataSource = obj.TypeAvailable; comboBoxEquipType.SelectedItem = obj.Type; comboBoxEquipID.DataSource = obj.IDAvailable; comboBoxEquipID.SelectedItem = obj.ID; numEquipLevel.Value = obj.Level; numSlots.Value = obj.Slots; if (_selEquip is MonHunTalisman) { MonHunTalisman tal = _selEquip as MonHunTalisman; comboBoxSkillFirst.DataSource = MonHunTalisman.dictSkills.Values.ToArray(); if (tal.SkillFirstKnown()) { comboBoxSkillFirst.SelectedItem = tal.SkillFirst; } else { comboBoxSkillFirst.Text = tal.SkillFirst; } comboBoxSkillSecond.BindingContext = new BindingContext(); comboBoxSkillSecond.DataSource = MonHunTalisman.dictSkills.Values.ToArray(); if (tal.SkillSecondKnown()) { comboBoxSkillSecond.SelectedItem = tal.SkillSecond; } else { comboBoxSkillSecond.Text = tal.SkillSecond; } textBoxSkillFirstValue.Text = tal.SkillFirstValue; textBoxSkillSecondValue.Text = tal.SkillSecondValue; textBoxTalRes1.Text = tal.UnkTal1; textBoxTalRes2.Text = tal.UnkTal2; } else { comboBoxSkillFirst.SelectedItem = null; comboBoxSkillFirst.DataSource = null; comboBoxSkillSecond.SelectedItem = null; comboBoxSkillSecond.DataSource = null; textBoxSkillFirstValue.Text = string.Empty; textBoxSkillSecondValue.Text = string.Empty; textBoxTalRes1.Text = string.Empty; textBoxTalRes2.Text = string.Empty; } _equipSelectionUpdating = false; }