public StructureBspSelectDialog(IndexEntry scenario) : this() { //Prepare Block bspReference = new ScenarioStructureBspReferenceBlock(); //Check if (scenario != null) { using (BinaryReader reader = scenario.TagData.CreateReader()) //Create reader { //Read scenario structure bsp reference tag block scenario.TagData.Seek(scenario.Offset + 528, SeekOrigin.Begin); int sbspRefsCount = reader.ReadInt32(); uint sbspRefsOffset = reader.ReadUInt32(); if (sbspRefsCount > 0) { //Goto scenario.TagData.Seek(sbspRefsOffset, SeekOrigin.Begin); //Loop for (int i = 0; i < sbspRefsCount; i++) { //Read reference bspReference.Read(reader); //Add StructureBspObject bspObject = new StructureBspObject(bspReference.ToString(), i); structureBspBlockComboBox.Items.Add(bspObject); } } } } }
private StructureBspSelectDialog() { InitializeComponent(); //Add none StructureBspObject none = new StructureBspObject("none", 0); structureBspBlockComboBox.Items.Add(none); //Select structureBspBlockComboBox.SelectedIndex = 0; }