private void UpdateLevel(object sender, EventArgs e) { _character.Level = (byte)numLevel.Value; var minEternalSeals = _character.GetMinimumEternalSealsForCurrentLevel(); if (_character.EternalSealsUsed < minEternalSeals) { numEternalSeals.Value = minEternalSeals; _character.EternalSealsUsed = minEternalSeals; } var maxLevel = _character.GetModifiedMaxLevel(); if (_character.Level == maxLevel) { numExperience.Value = 0; _character.Experience = 0; numExperience.Enabled = false; } else { numExperience.Enabled = true; } }
private void UpdateClass(object sender, EventArgs e) { var cmb = (ComboBox)sender; _character.ClassID = (Enums.Class)cmb.SelectedValue; // If they changed to a class with a lower max level, drop the level to the new max var maxLevel = _character.GetModifiedMaxLevel(); if (_character.Level > maxLevel) { numLevel.Value = maxLevel; _character.Level = maxLevel; } }