private void Edit_Click(object sender, EventArgs e) { if (Edit.BackColor == SystemColors.Control) { Edit.BackColor = SystemColors.ControlDark; StatBase.ReadOnly = false; } else { Edit.BackColor = SystemColors.Control; StatBase.ReadOnly = true; int result; if (int.TryParse(StatBase.Text, out result)) { if (result > 30) { result = 30; } else if (result < 0) { result = 0; } } else { result = 0; } cStat.StatBase = result; charSheetMain.Refresh_Click(this, null); } }
private void EditPlayermod_Click(object sender, EventArgs e) { if (EditPlayermod.BackColor == SystemColors.Control) { EditPlayermod.BackColor = SystemColors.ControlDark; PlayerMod.ReadOnly = false; } else { EditPlayermod.BackColor = SystemColors.Control; PlayerMod.ReadOnly = true; int result; string pmText = PlayerMod.Text; if (pmText.Contains("+")) { pmText = pmText.Remove(0, 1); } if (int.TryParse(pmText, out result)) { if (result > 30) { result = 30; } else if (result < -30) { result = -30; } } else { result = 0; } if (result > 0) { PlayerMod.Text = "+" + result.ToString(); } else { PlayerMod.Text = result.ToString(); } charSheetMain.Refresh_Click(this, null); } }
private void EditSpeed_Click(object sender, EventArgs e) { if (EditSpeed.BackColor == SystemColors.Control) { EditSpeed.BackColor = SystemColors.ControlDark; Speed.ReadOnly = false; } else { EditSpeed.BackColor = SystemColors.Control; Speed.ReadOnly = true; int result; string acText = Speed.Text; if (int.TryParse(acText, out result)) { if (result > 1000) { result = 1000; } else if (result < 0) { result = 0; } else { result = result - (result % 5); } } else { result = 0; } cStat.StatBase = cStat.StatBase + (result - cStat.Value); charSheetMain.Refresh_Click(this, null); } }
private void Proficiency_CheckedChanged(object sender, EventArgs e) { charSheetMain.Refresh_Click(this, null); }