private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
if (Path.GetExtension(openFileDialog1.FileName).ToUpper().Equals(".GBA"))
{
selectedROMPath = openFileDialog1.FileName;
numericUpDown1_ValueChanged(sender, e);
comboBox1_SelectedIndexChanged(sender, e);
string romCode = GetROMCode();
btnDecompile.Enabled = true;
txtDecompileOffset.Enabled = true;
btnDecompile2.Enabled = true;
btnChangeMoveScriptPointer.Enabled = true;
numericUpDown1.Enabled = true;
txtMoveEffectScriptLocation.Enabled = true;
comboBox1.Enabled = true;
textBox1.Enabled = true;
button1.Enabled = true;
button2.Enabled = true;
txtRomPath.Text = selectedROMPath;
}
else
{
try
{
CreateNewTab(openFileDialog1.FileName);
scripts[tabControl1.SelectedIndex].Lines = File.ReadAllLines(openFileDialog1.FileName);
unsaved[tabControl1.SelectedIndex] = false;
}
catch
{
MessageBox.Show("The file could not be opened.");
}
}
}
}