private void button4_Click(object sender, EventArgs e) { int b = m.loadSecondaryScriptRef((group), (byte)nMap.Value); if (b == -1) { MessageBox.Show("That map does not have a secondary script.", "Error"); return; } sl = b; gb.BufferLocation = b; gb.WriteByte((byte)map); MessageBox.Show("Map swapped.", "Success"); panel2.Visible = false; panel1.Visible = true; nScript.Value = gb.ReadByte(); }
public frmSecondaryScript(GBHL.GBFile g, MapScripts ms, int grp, int mp) { gb = g; m = ms; group = grp; map = mp; InitializeComponent(); int i = m.loadSecondaryScriptRef(group, map); sl = i; if (i == -1) { panel2.Visible = true; } else { panel1.Visible = true; nScript.Value = gb.ReadByte(i + 1); } }