void LoadToolStripMenuItemClick(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "GB ROM Image (*.gb)|*.gb"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { Rom newRom = new Rom(); newRom.Load(openFileDialog1.FileName); if (newRom.Title == "SUPERMARIOLAND3") { rom = newRom; LoadLevelCombobox(); Level.DumpBonusSprites(rom); Level.DumpPlayerSprite(rom); romFilePath = openFileDialog1.FileName; if (levelComboBox.SelectedIndex == 0) { LevelComboBoxSelectedIndexChanged(sender, e); } else { levelComboBox.SelectedIndex = 0; } toolboxToolStripMenuItem.Enabled = true; saveAsToolStripMenuItem.Enabled = true; levelComboBox.Visible = true; LevelPanel.Visible = true; } else { MessageBox.Show("Please select a valid WarioLand 1 rom", Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
void LoadToolStripMenuItemClick(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "GB ROM Image (*.gb)|*.gb"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { Rom newRom = new Rom(); newRom.Load(openFileDialog1.FileName); if (newRom.Title == "SUPERMARIOLAND3") { rom = newRom; LoadLevelCombobox(); romFilePath = openFileDialog1.FileName; if(levelComboBox.SelectedIndex == 0) LevelComboBoxSelectedIndexChanged(sender, e); else levelComboBox.SelectedIndex = 0; saveToolStripMenuItem.Enabled = true; saveAsToolStripMenuItem.Enabled = true; levelComboBox.Visible = true; LevelPanel.Visible = true; tilesPictureBox.Visible = true; objectPictureBox.Visible = true; } else { MessageBox.Show("Please select a valid WarioLand 1 rom", Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } }