private void UpdateGeStTextBoxes() { var charInfo = Savedata.GetCharacterInfo(_currentCharIndex); _currentCharInfo = charInfo; for (int i = 0; i < GeneralInfoTextBoxes.Length; i++) { GeneralInfoTextBoxes[i].Text = _currentCharInfo.GeneralInfo[i].ToString(); } for (int i = 0; i < StatsTextBoxes.Length; i++) { StatsTextBoxes[i].Text = _currentCharInfo.Stats[i].ToString(); } }
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "SAVEDATA|SAVEDATA|*.*|*.*"; sfd.FileName = "SAVEDATA"; if (sfd.ShowDialog() != DialogResult.OK) { return; } if (!Savedata.WriteToFile(sfd.FileName)) { return; } MessageBox.Show("Saved as:\n" + sfd.FileName, "Saved", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); _savedatafile = sfd.FileName; label2.Text = sfd.FileName; }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.Filter = "SAVEDATA|SAVEDATA|*.*|*.*"; if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; } if (!Savedata.LoadFromFile(openFileDialog1.FileName)) { return; } _savedatafile = openFileDialog1.FileName; saveAsToolStripMenuItem.Enabled = true; saveToolStripMenuItem.Enabled = true; tabControl1.Visible = true; label2.Text = _savedatafile; lstChar.SelectedIndex = -1; TextBoxesSetEnabledState(false); TextBoxesClearAll(); }