private void selectEncounterComboBox_SelectedIndexChanged(object sender, EventArgs e) { string encounterFileIndex = selectEncounterComboBox.SelectedIndex.ToString("D4"); currentFile = new EncounterFileDPPt(new FileStream(encounterFileFolder + "\\" + encounterFileIndex, FileMode.Open)); SetupControls(); }
private void addEncounterFileButton_Click(object sender, EventArgs e) { /* Load new encounter, a copy of encounter 0 */ int encounterCount = selectEncounterComboBox.Items.Count; EncounterFile newEncounter = new EncounterFileDPPt(new FileStream(encounterFileFolder + "\\" + 0.ToString("D4"), FileMode.Open)); /* Add new encounter file to encounter folder */ string encounterFilePath = encounterFileFolder + "\\" + encounterCount.ToString("D4"); using (BinaryWriter writer = new BinaryWriter(new FileStream(encounterFilePath, FileMode.Create))) writer.Write(newEncounter.SaveEncounterFile()); /* Update ComboBox*/ selectEncounterComboBox.Items.Add("[New] Encounters File " + encounterCount.ToString()); }
private void importEncounterFileButton_Click(object sender, EventArgs e) { /* Prompt user to select .wld file */ OpenFileDialog of = new OpenFileDialog(); of.Filter = "Wild Encounters File (*.wld)|*.wld"; if (of.ShowDialog(this) != DialogResult.OK) { return; } /* Update encounter file object in memory */ currentFile = new EncounterFileDPPt(new FileStream(of.FileName, FileMode.Open)); /* Update controls */ SetupControls(); }