public void LoadSettings(FileParser.Block block) { sourceFileName = block.GetString("Obj File"); if (sourceFileName != "") { LoadFile(); } if (block.GetBool("Use Custom Address")) { //Set a checkbox here segmentOffset = block.GetInt("Custom Address"); } pointerControl1.SetROMPointers(block.GetIntArray("ROM Pointers")); pointerControl1.SetRAMPointers(block.GetIntArray("RAM Pointers")); string specialPointerString = block.GetString("Special Pointers", false); if (specialPointerString != null) { string[] split = specialPointerString.Split(';'); List <SpecialPointer> validPointers = new List <SpecialPointer>(); foreach (string s in split) { SpecialPointer newPointer = specialPointerControl1.PointerByString(s.Trim()); if (newPointer != null) { validPointers.Add(newPointer); } } specialPointerControl1.SetPointers(validPointers.ToArray()); } cmbTypeStyle.SelectedIndex = block.GetInt("Type Style", false); foreach (Control control in panelCollisionTypes.Controls) { CollisionTypeControl c = control as CollisionTypeControl; if (c != null) { c.SetType(block.GetInt(c.patch.name, false)); c.enableImport = block.GetBool(c.patch.name + " enabled", false); } } int[] specialBoxTypes = block.GetIntArray("Special Boxes", false); int[] specialBoxX1 = block.GetIntArray("Special Boxes X1", false); int[] specialBoxX2 = block.GetIntArray("Special Boxes X2", false); int[] specialBoxZ1 = block.GetIntArray("Special Boxes Z1", false); int[] specialBoxZ2 = block.GetIntArray("Special Boxes Z2", false); int[] specialBoxY = block.GetIntArray("Special Boxes Height", false); if (specialBoxTypes.Length > 0) { collision.specialBoxes = new SpecialBoxes(); } for (int i = 0; i < specialBoxTypes.Length; i++) { SpecialCollisionBox box = new SpecialCollisionBox(); box.type = (short)specialBoxTypes[i]; if (i < specialBoxX1.Length) { box.x1 = (short)specialBoxX1[i]; } if (i < specialBoxX2.Length) { box.x2 = (short)specialBoxX2[i]; } if (i < specialBoxZ1.Length) { box.z1 = (short)specialBoxZ1[i]; } if (i < specialBoxZ2.Length) { box.z2 = (short)specialBoxZ2[i]; } if (i < specialBoxY.Length) { box.y = (short)specialBoxY[i]; } collision.specialBoxes.boxes.Add(box); } }