public void Read(BinaryReader reader) { _signature.Read(reader); _width.Read(reader); _height.Read(reader); _depth.Read(reader); _type.Read(reader); _format.Read(reader); _flags.Read(reader); _registrationPoint.Read(reader); _mipmapCount.Read(reader); __unnamed.Read(reader); _pixelsOffset.Read(reader); __unnamed2.Read(reader); __unnamed3.Read(reader); __unnamed4.Read(reader); __unnamed5.Read(reader); _baseAddress.Read(reader); }
private void buttonX1_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Halo 2 Tags (*.*)|*.*"; if (Global.Application.Instance.IsProjectOpen != false) { ofd.InitialDirectory = Global.Application.Instance.Project.TagFolder; } if (ofd.ShowDialog() == DialogResult.OK) { // Open tag EndianReader br = new EndianReader(IO.Endianness.Little, new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.Read)); // Get Ext string ext = ofd.FileName.Substring(ofd.FileName.LastIndexOf(".") + 1); TagDefinition tagdef = EngineManager.Engines[Global.Application.Instance.Project.Engine].CreateInstance(ext); // Read tagdef.Read(br); // Close br.Close(); // See if tag belongs to this project if (!Global.Application.Instance.Project.Tags.Contains(tagdef.AbsolutePath)) { // Ask to add if (MessageBox.Show("Mutation has detected this tag does not belong to the opened project.\r\nWould you like to add it to the project?", "Add tag to project", MessageBoxButtons.YesNo) == DialogResult.Yes) { // Add MessageBox.Show("This feature has not yet been enabled in Mutation.\r\nPlease wait for a new build.", "Future feature"); return; } } else { Reference = tagdef.AbsolutePath; this.textEdit1.Text = Reference; textEdit1.ForeColor = Color.RoyalBlue; } } }
//public TagEditorPage(string Class) //{ // //Suspend Layout // this.SuspendLayout(); // // Set Fields // saved = false; // // Load tagdef // plugin = EngineManager.Engines[Global.Application.Instance.Project.Engine].CreateInstance(Class); // // Create Panel // Panel panel = new Panel(); // panel.SuspendLayout(); // panel.Dock = DockStyle.Fill; // panel.AutoScroll = true; // panel.AutoSize = true; // panel.BackColor = Color.FromKnownColor(KnownColor.Control); // // Load into panel // LoadIntoPanel(); // // Update Tab // this.Text = "New_Tag." + plugin.CompiledClass + "*"; // panel.ResumeLayout(); // this.Controls.Add(panel); // //Resume // this.ResumeLayout(); //} public void Open(string Location) { // Open the tag this.path = Location; EndianReader br = new EndianReader(Endianness.Little, new FileStream(Location, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)); // Create tag def string Ext = Location.Substring(Location.LastIndexOf(".") + 1); plugin = EngineManager.Engines[Global.Application.Instance.Project.Engine].CreateInstance(Ext); // Read plugin.Read(br); // Close br.Close(); // Load into panel LoadIntoPanel(); // Set the tab name. this.Text = Location.Substring(Location.LastIndexOf("\\") + 1); }