From 2ebf85f3fb392164acbadc94d5b39a571b57e0c8 Mon Sep 17 00:00:00 2001 From: AdAstra-LD Date: Fri, 29 Jan 2021 13:18:22 +0100 Subject: [PATCH] NSBTX Editor & Map Editor - improved error detection --- DS_Map/LibNDSFormats/NSBMD/NSBMD.cs | 38 ++- DS_Map/LibNDSFormats/NSBTX/NSBTXLoader.cs | 16 +- DS_Map/LibNDSFormats/NSBTX/nsbtx.cs | 62 ++-- DS_Map/Main Window.Designer.cs | 370 +++++++++++----------- DS_Map/Main Window.cs | 55 ++-- DS_Map/Main Window.resx | 28 +- 6 files changed, 283 insertions(+), 286 deletions(-) diff --git a/DS_Map/LibNDSFormats/NSBMD/NSBMD.cs b/DS_Map/LibNDSFormats/NSBMD/NSBMD.cs index 9a7ec13..0bcb4cd 100644 --- a/DS_Map/LibNDSFormats/NSBMD/NSBMD.cs +++ b/DS_Map/LibNDSFormats/NSBMD/NSBMD.cs @@ -51,8 +51,7 @@ namespace LibNDSFormats.NSBMD /// public void MatchTextures() { - for (var i = 0; i < models.Length; i++) - { + for (var i = 0; i < models.Length; i++) { //models[i].Materials.Clear(); //models[i].Materials.AddRange(materials); /*int t7 = 0; @@ -88,17 +87,17 @@ namespace LibNDSFormats.NSBMD } }*/ int t7 = 0; - for (var j = 0; j < models[i].Polygons.Count - 1; j++) - { - for (int k = 0; k < models[i].Textures.Count; k++) - { - if (models[i].Textures[k].texmatid.Contains((uint)models[i].Polygons[j].MatId)) - { + for (var j = 0; j < models[i].Polygons.Count - 1; j++) { + for (int k = 0; k < models[i].Textures.Count; k++) { + if (models[i].Textures[k].texmatid.Contains((uint)models[i].Polygons[j].MatId)) { int texid = k; - for (int l = 0; l < Textures.Count; l++) - { - if (Textures[l].texname == models[i].Textures[k].texname) { texid = l; break; } + for (int l = 0; l < Textures.Count; l++) { + if (Textures[l].texname == models[i].Textures[k].texname) { + texid = l; + break; + } } + models[i].Materials[models[i].Polygons[j].MatId].spdata = Textures[texid].spdata; //RITORNA QUI models[i].Materials[models[i].Polygons[j].MatId].texdata = Textures[texid].texdata; models[i].Materials[models[i].Polygons[j].MatId].texname = Textures[texid].texname; @@ -111,16 +110,15 @@ namespace LibNDSFormats.NSBMD break; } } - if (models[i].Materials[models[i].Polygons[j].MatId].format != 7) - { - for (int k = 0; k < models[i].Palettes.Count; k++) - { - if (models[i].Palettes[k].palmatid.Contains((uint)models[i].Polygons[j].MatId)) - { + if (models[i].Materials[models[i].Polygons[j].MatId].format != 7) { + for (int k = 0; k < models[i].Palettes.Count; k++) { + if (models[i].Palettes[k].palmatid.Contains((uint)models[i].Polygons[j].MatId)) { int palid = k; - for (int l = 0; l < Palettes.Count; l++) - { - if (Palettes[l].palname == models[i].Palettes[k].palname) { palid = l; break; } + for (int l = 0; l < Palettes.Count; l++) { + if (Palettes[l].palname == models[i].Palettes[k].palname) { + palid = l; + break; + } } models[i].Materials[models[i].Polygons[j].MatId].paldata = Palettes[palid].paldata; models[i].Materials[models[i].Polygons[j].MatId].palname = Palettes[palid].palname; diff --git a/DS_Map/LibNDSFormats/NSBTX/NSBTXLoader.cs b/DS_Map/LibNDSFormats/NSBTX/NSBTXLoader.cs index 2b5bcaa..61c3d34 100644 --- a/DS_Map/LibNDSFormats/NSBTX/NSBTXLoader.cs +++ b/DS_Map/LibNDSFormats/NSBTX/NSBTXLoader.cs @@ -32,20 +32,22 @@ namespace LibNDSFormats.NSBTX var materials = new List(); var reader = new BinaryReader(stream); int id = reader.ReadInt32(); - if (id != NSBMD.NSBMD.NDS_TYPE_BTX0) + if (id != NSBMD.NSBMD.NDS_TYPE_BTX0) { Console.WriteLine("The header of this texture file is null!!!"); + return null; + } + int i = reader.ReadInt32(); - if (i == NSBMD.NSBMD.NDS_TYPE_MAGIC1) - { + if (i == NSBMD.NSBMD.NDS_TYPE_MAGIC1) { i = reader.ReadInt32(); - if (i == stream.Length) - { + + if (i == stream.Length) { int numblock = reader.ReadInt32(); numblock >>= 16; int r = reader.ReadInt32(); id = reader.ReadInt32(); - if (numblock == 1 && r == 0x14) - { + + if (numblock == 1 && r == 0x14) { int texnum; int palnum; materials.AddRange(ReadTex0(stream, 0x14, out texnum, out palnum, out texs, out pals)); diff --git a/DS_Map/LibNDSFormats/NSBTX/nsbtx.cs b/DS_Map/LibNDSFormats/NSBTX/nsbtx.cs index 60ebf9b..7e80d9d 100644 --- a/DS_Map/LibNDSFormats/NSBTX/nsbtx.cs +++ b/DS_Map/LibNDSFormats/NSBTX/nsbtx.cs @@ -179,8 +179,7 @@ namespace NSMBe4.NSBMD Array.Sort(palettes); - for (int i = 0; i < palettes.Length; i++) - { + for (int i = 0; i < palettes.Length; i++) { palettes[i].name = str.ReadString(16); if (i != palettes.Length - 1) palettes[i].size = palettes[i + 1].offs - palettes[i].offs; @@ -188,26 +187,20 @@ namespace NSMBe4.NSBMD } palettes[palettes.Length - 1].size = blockStart + palDataOffset + palDataSize - palettes[palettes.Length - 1].offs; - for (int i = 0; i < palettes.Length; i++) - { - if (hasFormat5) - { + for (int i = 0; i < palettes.Length; i++) { + if (hasFormat5) { FilePalette pa = new FilePalette(new InlineFile(f, palettes[i].offs, palettes[i].size, palettes[i].name, null, LZd ? InlineFile.CompressionType.LZWithHeaderComp : InlineFile.CompressionType.NoComp)); pal.Add((NSMBe4.Palette)pa); //mgr.m.addPalette(pa); - } - else - { + } else { int extrapalcount = (palettes[i].size) / 512; - for (int j = 0; j < extrapalcount; j++) - { + for (int j = 0; j < extrapalcount; j++) { FilePalette pa = new FilePalette(new InlineFile(f, palettes[i].offs + j * 512, 512, palettes[i].name + ":" + j, null, LZd ? InlineFile.CompressionType.LZWithHeaderComp : InlineFile.CompressionType.NoComp)); pal.Add((NSMBe4.Palette)pa); //mgr.m.addPalette(pa); } int lastsize = palettes[i].size % 512; - if (lastsize != 0) - { + if (lastsize != 0) { FilePalette pa = new FilePalette(new InlineFile(f, palettes[i].offs + extrapalcount * 512, lastsize, palettes[i].name + ":" + extrapalcount, null, LZd ? InlineFile.CompressionType.LZWithHeaderComp : InlineFile.CompressionType.NoComp)); pal.Add((NSMBe4.Palette)pa); //mgr.m.addPalette(pa); @@ -220,24 +213,20 @@ namespace NSMBe4.NSBMD // new ImagePreviewer(textures[0].render(palettes[0])).Show(); } - public void close() - { + public void close() { f.endEdit(this); } - public byte[] save() - { + public byte[] save() { f.replace(str.getData(), this); return str.getData(); } - public class PaletteDef : IComparable - { + public class PaletteDef : IComparable { public int offs, size; public string name; - public int CompareTo(PaletteDef b) - { + public int CompareTo(PaletteDef b) { return offs.CompareTo(b.offs); } } @@ -247,8 +236,7 @@ namespace NSMBe4.NSBMD public byte[] before; public byte[] after; public header Header; - public struct header - { + public struct header { public string ID; public byte[] Magic; public Int32 file_size; @@ -257,8 +245,7 @@ namespace NSMBe4.NSBMD public Int32[] Section_Offset; } public tex0 TEX0; - public struct tex0 - { + public struct tex0 { public string ID; public Int32 Section_size; public Int32 Padding1; @@ -296,15 +283,13 @@ namespace NSMBe4.NSBMD public List unknown1; public List unknown2; } - public struct Info - { + public struct Info { public short header_size; public short data_size; public texInfo[] TexInfo; - public struct texInfo - { + public struct texInfo { public Int32 Texture_Offset; //shift << 3, relative to start of Texture Data public Int16 Parameters; public byte Width; @@ -331,8 +316,7 @@ namespace NSMBe4.NSBMD } } public palInfo PalInfo; - public struct palInfo - { + public struct palInfo { public byte dummy; public byte num_objs; public short section_size; @@ -340,8 +324,7 @@ namespace NSMBe4.NSBMD public Info infoBlock; public List names; - public struct UnknownBlock - { + public struct UnknownBlock { public short header_size; public short section_size; public int constant; // 0x017F @@ -349,8 +332,7 @@ namespace NSMBe4.NSBMD public List unknown1; public List unknown2; } - public struct Info - { + public struct Info { public short header_size; public short data_size; @@ -367,11 +349,15 @@ namespace NSMBe4.NSBMD int[] bpp = { 0, 8, 2, 4, 8, 2, 8, 16 }; - public NSBTX_File(FileStream f) - { + public NSBTX_File(FileStream f) { EndianBinaryReader er = new EndianBinaryReader(f, Endianness.LittleEndian); + if (f.Length <= 4) { + MessageBox.Show("Error: Texture file is too small.", null, MessageBoxButtons.OK, MessageBoxIcon.Stop); + er.Close(); + return; + } if (er.ReadString(Encoding.ASCII, 4) != "BTX0") { - MessageBox.Show("Error", null, MessageBoxButtons.OK, MessageBoxIcon.Stop); + MessageBox.Show("Error: BTX header is wrong.", null, MessageBoxButtons.OK, MessageBoxIcon.Stop); er.Close(); return; } else { diff --git a/DS_Map/Main Window.Designer.cs b/DS_Map/Main Window.Designer.cs index 4e1250b..852f5d7 100644 --- a/DS_Map/Main Window.Designer.cs +++ b/DS_Map/Main Window.Designer.cs @@ -174,8 +174,11 @@ this.matrixNameLabel = new System.Windows.Forms.Label(); this.matrixTabControl = new System.Windows.Forms.TabControl(); this.headersTabPage = new System.Windows.Forms.TabPage(); + this.headersGridView = new DSPRE.DataGridViewDoubleBuffered(); this.heightsTabPage = new System.Windows.Forms.TabPage(); + this.heightsGridView = new DSPRE.DataGridViewDoubleBuffered(); this.mapFilesTabPage = new System.Windows.Forms.TabPage(); + this.mapFilesGridView = new DSPRE.DataGridViewDoubleBuffered(); this.matrixNameTextBox = new System.Windows.Forms.TextBox(); this.heightUpDown = new System.Windows.Forms.NumericUpDown(); this.widthUpDown = new System.Windows.Forms.NumericUpDown(); @@ -581,9 +584,6 @@ this.headerSearchToolStripButton = new System.Windows.Forms.ToolStripButton(); this.versionLabel = new System.Windows.Forms.Label(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.headersGridView = new DSPRE.DataGridViewDoubleBuffered(); - this.heightsGridView = new DSPRE.DataGridViewDoubleBuffered(); - this.mapFilesGridView = new DSPRE.DataGridViewDoubleBuffered(); this.mainTabControl.SuspendLayout(); this.headerEditorTabPage.SuspendLayout(); this.worldmapCoordsGroupBox.SuspendLayout(); @@ -614,8 +614,11 @@ this.matrixEditorTabPage.SuspendLayout(); this.matrixTabControl.SuspendLayout(); this.headersTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.headersGridView)).BeginInit(); this.heightsTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.heightsGridView)).BeginInit(); this.mapFilesTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.mapFilesGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.heightUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.widthUpDown)).BeginInit(); this.mapEditorTabPage.SuspendLayout(); @@ -734,9 +737,6 @@ this.menuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.mainToolStrip.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.headersGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.heightsGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.mapFilesGridView)).BeginInit(); this.SuspendLayout(); // // mainTabControl @@ -2258,6 +2258,62 @@ this.headersTabPage.Text = "Map Headers"; this.headersTabPage.UseVisualStyleBackColor = true; // + // headersGridView + // + this.headersGridView.AllowUserToAddRows = false; + this.headersGridView.AllowUserToDeleteRows = false; + this.headersGridView.AllowUserToResizeColumns = false; + this.headersGridView.AllowUserToResizeRows = false; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.headersGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.headersGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.headersGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.headersGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.headersGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle3.Format = "D4"; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.headersGridView.DefaultCellStyle = dataGridViewCellStyle3; + this.headersGridView.Location = new System.Drawing.Point(0, 0); + this.headersGridView.Name = "headersGridView"; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.headersGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle4; + this.headersGridView.RowHeadersWidth = 50; + this.headersGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.headersGridView.RowsDefaultCellStyle = dataGridViewCellStyle5; + this.headersGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.headersGridView.RowTemplate.Height = 18; + this.headersGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.headersGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; + this.headersGridView.ShowCellErrors = false; + this.headersGridView.Size = new System.Drawing.Size(1032, 566); + this.headersGridView.TabIndex = 1; + this.headersGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.headersGridView_CellFormatting); + this.headersGridView.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.headersGridView_CellMouseDoubleClick); + this.headersGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.headersGridView_CellValueChanged); + // // heightsTabPage // this.heightsTabPage.Controls.Add(this.heightsGridView); @@ -2268,6 +2324,60 @@ this.heightsTabPage.Text = "Map Heights"; this.heightsTabPage.UseVisualStyleBackColor = true; // + // heightsGridView + // + this.heightsGridView.AllowUserToAddRows = false; + this.heightsGridView.AllowUserToDeleteRows = false; + this.heightsGridView.AllowUserToResizeColumns = false; + this.heightsGridView.AllowUserToResizeRows = false; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.heightsGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; + this.heightsGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.heightsGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.heightsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; + this.heightsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle8.Font = new System.Drawing.Font("Tahoma", 8.25F); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle8.Format = "D2"; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.heightsGridView.DefaultCellStyle = dataGridViewCellStyle8; + this.heightsGridView.Location = new System.Drawing.Point(0, 0); + this.heightsGridView.Name = "heightsGridView"; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.heightsGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle9; + this.heightsGridView.RowHeadersWidth = 50; + this.heightsGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.heightsGridView.RowsDefaultCellStyle = dataGridViewCellStyle10; + this.heightsGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.heightsGridView.RowTemplate.Height = 18; + this.heightsGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.heightsGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; + this.heightsGridView.Size = new System.Drawing.Size(1032, 566); + this.heightsGridView.TabIndex = 2; + this.heightsGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.heightsGridView_CellFormatting); + this.heightsGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.heightsGridView_CellValueChanged); + // // mapFilesTabPage // this.mapFilesTabPage.Controls.Add(this.mapFilesGridView); @@ -2278,6 +2388,61 @@ this.mapFilesTabPage.Text = "Map Files"; this.mapFilesTabPage.UseVisualStyleBackColor = true; // + // mapFilesGridView + // + this.mapFilesGridView.AllowUserToAddRows = false; + this.mapFilesGridView.AllowUserToDeleteRows = false; + this.mapFilesGridView.AllowUserToResizeColumns = false; + this.mapFilesGridView.AllowUserToResizeRows = false; + dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.mapFilesGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11; + this.mapFilesGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.mapFilesGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mapFilesGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12; + this.mapFilesGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle13.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle13.Format = "D4"; + dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.mapFilesGridView.DefaultCellStyle = dataGridViewCellStyle13; + this.mapFilesGridView.Location = new System.Drawing.Point(0, 0); + this.mapFilesGridView.Name = "mapFilesGridView"; + dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle14.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mapFilesGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle14; + this.mapFilesGridView.RowHeadersWidth = 50; + this.mapFilesGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle15.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.mapFilesGridView.RowsDefaultCellStyle = dataGridViewCellStyle15; + this.mapFilesGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.mapFilesGridView.RowTemplate.Height = 18; + this.mapFilesGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.mapFilesGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; + this.mapFilesGridView.Size = new System.Drawing.Size(1032, 566); + this.mapFilesGridView.TabIndex = 2; + this.mapFilesGridView.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mapFilesGridView_CellMouseDoubleClick); + this.mapFilesGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.mapFilesGridView_CellFormatting); + this.mapFilesGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.mapFilesGridView_CellValueChanged); + // // matrixNameTextBox // this.matrixNameTextBox.Location = new System.Drawing.Point(13, 73); @@ -2576,7 +2741,7 @@ // // buildingHeightUpDown // - this.buildingHeightUpDown.Location = new System.Drawing.Point(346, 217); + this.buildingHeightUpDown.Location = new System.Drawing.Point(349, 217); this.buildingHeightUpDown.Name = "buildingHeightUpDown"; this.buildingHeightUpDown.Size = new System.Drawing.Size(50, 20); this.buildingHeightUpDown.TabIndex = 24; @@ -2584,7 +2749,7 @@ // // buildingLengthUpDown // - this.buildingLengthUpDown.Location = new System.Drawing.Point(269, 217); + this.buildingLengthUpDown.Location = new System.Drawing.Point(270, 217); this.buildingLengthUpDown.Name = "buildingLengthUpDown"; this.buildingLengthUpDown.Size = new System.Drawing.Size(50, 20); this.buildingLengthUpDown.TabIndex = 23; @@ -2592,7 +2757,7 @@ // // buildingWidthUpDown // - this.buildingWidthUpDown.Location = new System.Drawing.Point(191, 217); + this.buildingWidthUpDown.Location = new System.Drawing.Point(194, 217); this.buildingWidthUpDown.Name = "buildingWidthUpDown"; this.buildingWidthUpDown.Size = new System.Drawing.Size(50, 20); this.buildingWidthUpDown.TabIndex = 22; @@ -2600,7 +2765,7 @@ // // importBuildingsButton // - this.importBuildingsButton.Location = new System.Drawing.Point(301, 13); + this.importBuildingsButton.Location = new System.Drawing.Point(302, 13); this.importBuildingsButton.Name = "importBuildingsButton"; this.importBuildingsButton.Size = new System.Drawing.Size(102, 38); this.importBuildingsButton.TabIndex = 21; @@ -2621,7 +2786,7 @@ // label20 // this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(343, 202); + this.label20.Location = new System.Drawing.Point(346, 202); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(38, 13); this.label20.TabIndex = 19; @@ -2630,7 +2795,7 @@ // label19 // this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(266, 201); + this.label19.Location = new System.Drawing.Point(267, 201); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(40, 13); this.label19.TabIndex = 18; @@ -2639,7 +2804,7 @@ // label18 // this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(188, 201); + this.label18.Location = new System.Drawing.Point(191, 201); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(35, 13); this.label18.TabIndex = 17; @@ -2838,7 +3003,7 @@ this.exteriorbldRadioButton.AutoSize = true; this.exteriorbldRadioButton.Checked = true; this.exteriorbldRadioButton.Enabled = false; - this.exteriorbldRadioButton.Location = new System.Drawing.Point(329, 143); + this.exteriorbldRadioButton.Location = new System.Drawing.Point(338, 143); this.exteriorbldRadioButton.Name = "exteriorbldRadioButton"; this.exteriorbldRadioButton.Size = new System.Drawing.Size(60, 17); this.exteriorbldRadioButton.TabIndex = 4; @@ -2850,7 +3015,7 @@ // this.interiorbldRadioButton.AutoSize = true; this.interiorbldRadioButton.Enabled = false; - this.interiorbldRadioButton.Location = new System.Drawing.Point(266, 143); + this.interiorbldRadioButton.Location = new System.Drawing.Point(275, 143); this.interiorbldRadioButton.Name = "interiorbldRadioButton"; this.interiorbldRadioButton.Size = new System.Drawing.Size(57, 17); this.interiorbldRadioButton.TabIndex = 3; @@ -2861,7 +3026,7 @@ // modelNumberLabel // this.modelNumberLabel.AutoSize = true; - this.modelNumberLabel.Location = new System.Drawing.Point(190, 145); + this.modelNumberLabel.Location = new System.Drawing.Point(191, 145); this.modelNumberLabel.Name = "modelNumberLabel"; this.modelNumberLabel.Size = new System.Drawing.Size(68, 13); this.modelNumberLabel.TabIndex = 2; @@ -2871,7 +3036,7 @@ // this.buildIndexComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.buildIndexComboBox.FormattingEnabled = true; - this.buildIndexComboBox.Location = new System.Drawing.Point(192, 161); + this.buildIndexComboBox.Location = new System.Drawing.Point(193, 161); this.buildIndexComboBox.Name = "buildIndexComboBox"; this.buildIndexComboBox.Size = new System.Drawing.Size(211, 21); this.buildIndexComboBox.TabIndex = 1; @@ -7076,171 +7241,6 @@ this.versionLabel.TabIndex = 9; this.versionLabel.Text = "ROM:"; // - // headersGridView - // - this.headersGridView.AllowUserToAddRows = false; - this.headersGridView.AllowUserToDeleteRows = false; - this.headersGridView.AllowUserToResizeColumns = false; - this.headersGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.headersGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; - this.headersGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.headersGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.headersGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; - this.headersGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle3.Format = "D4"; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.headersGridView.DefaultCellStyle = dataGridViewCellStyle3; - this.headersGridView.Location = new System.Drawing.Point(0, 0); - this.headersGridView.Name = "headersGridView"; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.headersGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle4; - this.headersGridView.RowHeadersWidth = 50; - this.headersGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.headersGridView.RowsDefaultCellStyle = dataGridViewCellStyle5; - this.headersGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.headersGridView.RowTemplate.Height = 18; - this.headersGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.headersGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.headersGridView.ShowCellErrors = false; - this.headersGridView.Size = new System.Drawing.Size(1032, 566); - this.headersGridView.TabIndex = 1; - this.headersGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.headersGridView_CellFormatting); - this.headersGridView.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.headersGridView_CellMouseDoubleClick); - this.headersGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.headersGridView_CellValueChanged); - // - // heightsGridView - // - this.heightsGridView.AllowUserToAddRows = false; - this.heightsGridView.AllowUserToDeleteRows = false; - this.heightsGridView.AllowUserToResizeColumns = false; - this.heightsGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.heightsGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; - this.heightsGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.heightsGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.heightsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; - this.heightsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle8.Font = new System.Drawing.Font("Tahoma", 8.25F); - dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle8.Format = "D2"; - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.heightsGridView.DefaultCellStyle = dataGridViewCellStyle8; - this.heightsGridView.Location = new System.Drawing.Point(0, 0); - this.heightsGridView.Name = "heightsGridView"; - dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.heightsGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle9; - this.heightsGridView.RowHeadersWidth = 50; - this.heightsGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle10.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.heightsGridView.RowsDefaultCellStyle = dataGridViewCellStyle10; - this.heightsGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.heightsGridView.RowTemplate.Height = 18; - this.heightsGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.heightsGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.heightsGridView.Size = new System.Drawing.Size(1032, 566); - this.heightsGridView.TabIndex = 2; - this.heightsGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.heightsGridView_CellFormatting); - this.heightsGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.heightsGridView_CellValueChanged); - // - // mapFilesGridView - // - this.mapFilesGridView.AllowUserToAddRows = false; - this.mapFilesGridView.AllowUserToDeleteRows = false; - this.mapFilesGridView.AllowUserToResizeColumns = false; - this.mapFilesGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.mapFilesGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11; - this.mapFilesGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.mapFilesGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.mapFilesGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12; - this.mapFilesGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle13.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle13.Format = "D4"; - dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.mapFilesGridView.DefaultCellStyle = dataGridViewCellStyle13; - this.mapFilesGridView.Location = new System.Drawing.Point(0, 0); - this.mapFilesGridView.Name = "mapFilesGridView"; - dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle14.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.mapFilesGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle14; - this.mapFilesGridView.RowHeadersWidth = 50; - this.mapFilesGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle15.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.mapFilesGridView.RowsDefaultCellStyle = dataGridViewCellStyle15; - this.mapFilesGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.mapFilesGridView.RowTemplate.Height = 18; - this.mapFilesGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.mapFilesGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.mapFilesGridView.Size = new System.Drawing.Size(1032, 566); - this.mapFilesGridView.TabIndex = 2; - this.mapFilesGridView.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mapFilesGridView_CellMouseDoubleClick); - this.mapFilesGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.mapFilesGridView_CellFormatting); - this.mapFilesGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.mapFilesGridView_CellValueChanged); - // // MainProgram // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -7300,8 +7300,11 @@ this.matrixEditorTabPage.PerformLayout(); this.matrixTabControl.ResumeLayout(false); this.headersTabPage.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.headersGridView)).EndInit(); this.heightsTabPage.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.heightsGridView)).EndInit(); this.mapFilesTabPage.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.mapFilesGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.heightUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.widthUpDown)).EndInit(); this.mapEditorTabPage.ResumeLayout(false); @@ -7454,9 +7457,6 @@ this.statusStrip1.PerformLayout(); this.mainToolStrip.ResumeLayout(false); this.mainToolStrip.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.headersGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.heightsGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.mapFilesGridView)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/DS_Map/Main Window.cs b/DS_Map/Main Window.cs index f7c17b4..2d1c9af 100644 --- a/DS_Map/Main Window.cs +++ b/DS_Map/Main Window.cs @@ -527,13 +527,13 @@ namespace DSPRE { /* Fill map textures list */ mapTextureComboBox.Items.Add("Untextured"); for (int i = 0; i < romInfo.GetMapTexturesCount(); i++) - mapTextureComboBox.Items.Add("Texture " + i); + mapTextureComboBox.Items.Add("Map Texture Pack [" + i.ToString("D2") + "]"); toolStripProgressBar.Value++; /* Fill building textures list */ buildTextureComboBox.Items.Add("Untextured"); for (int i = 0; i < romInfo.GetBuildingTexturesCount(); i++) - buildTextureComboBox.Items.Add("Texture " + i); + buildTextureComboBox.Items.Add("Building Texture Pack [" + i.ToString("D2") + "]"); toolStripProgressBar.Value++; foreach (string s in PokeDatabase.System.MapCollisionPainters) { @@ -551,12 +551,10 @@ namespace DSPRE { collisionTypePainterComboBox.SelectedIndex = 0; collisionPainterComboBox.SelectedIndex = 1; - toolStripProgressBar.Value = 0; toolStripProgressBar.Visible = false; disableHandlers = false; - //Default selections selectMapComboBox.SelectedIndex = 0; exteriorbldRadioButton.Checked = true; @@ -578,7 +576,6 @@ namespace DSPRE { break; }; } - private void updateBuildingListComboBox(bool interior) { string[] bldList = GetBuildingsList(interior); for (int i = 0; i < bldList.Length; i++) { @@ -586,7 +583,6 @@ namespace DSPRE { } toolStripProgressBar.Value++; } - private void SetupMatrixEditor() { statusLabel.Text = "Setting up Matrix Editor..."; Update(); @@ -717,9 +713,7 @@ namespace DSPRE { unpack.Start(); unpack.WaitForExit(); } - #endregion - private void asmHacksToolStripMenuItem_Click(object sender, EventArgs e) { using (ROMToolboxDialog window = new ROMToolboxDialog(romInfo)) { window.ShowDialog(); @@ -2685,23 +2679,26 @@ namespace DSPRE { string texturePath = romInfo.buildingTexturesDirPath + "\\" + (buildTextureComboBox.SelectedIndex - 1).ToString("D4"); byte[] textureFile = File.ReadAllBytes(texturePath); - if (textureFile.Length > 4) { - showBuildingTextures = true; + Stream str = new MemoryStream(textureFile); + foreach (Building building in currentMapFile.buildings) { + str.Position = 0; + building.NSBMDFile.materials = NSBTXLoader.LoadNsbtx(str, out building.NSBMDFile.Textures, out building.NSBMDFile.Palettes); - Stream str = new MemoryStream(textureFile); - foreach (Building building in currentMapFile.buildings) { - str.Position = 0; - building.NSBMDFile.materials = NSBTXLoader.LoadNsbtx(str, out building.NSBMDFile.Textures, out building.NSBMDFile.Palettes); - try { - building.NSBMDFile.MatchTextures(); - } catch { } + try { + building.NSBMDFile.MatchTextures(); + showBuildingTextures = true; + } catch { + if (!buildTextureComboBox.Items[buildTextureComboBox.SelectedIndex].ToString().StartsWith("Error!")) { + disableHandlers = true; + buildTextureComboBox.Items[buildTextureComboBox.SelectedIndex] = buildTextureComboBox.Items[buildTextureComboBox.SelectedIndex].ToString().Insert(0, "Error! - "); + disableHandlers = false; + } + showBuildingTextures = false; } - } else { - disableHandlers = true; - buildTextureComboBox.Items[buildTextureComboBox.SelectedIndex] = "Texture file too small (" + (buildTextureComboBox.SelectedIndex - 1) + ")"; - disableHandlers = false; - showBuildingTextures = false; } + //buildTextureComboBox.Items[buildTextureComboBox.SelectedIndex] = "Error - Building Texture Pack too small [" + (buildTextureComboBox.SelectedIndex - 1).ToString("D2") + "]"; + + } RenderMap(ref mapRenderer, ref buildingsRenderer, ref currentMapFile, ang, dist, elev, perspective, mapOpenGlControl.Width, mapOpenGlControl.Height, mapTexturesOn, showBuildingTextures); @@ -6119,6 +6116,10 @@ namespace DSPRE { } catch { } } private void texturePacksListBox_SelectedIndexChanged(object sender, EventArgs e) { + if (disableHandlers) + return; + disableHandlers = true; + /* Clear ListBoxes */ texturesListBox.Items.Clear(); palettesListBox.Items.Clear(); @@ -6132,10 +6133,20 @@ namespace DSPRE { currentTileset = new NSMBe4.NSBMD.NSBTX_File(new FileStream(tilesetPath, FileMode.Open)); + string currentItemName = texturePacksListBox.Items[texturePacksListBox.SelectedIndex].ToString(); + + if (currentTileset.TexInfo.names == null || currentTileset.PalInfo.names == null) { + if (!currentItemName.StartsWith("Error!")) + texturePacksListBox.Items[texturePacksListBox.SelectedIndex] = "Error! - " + currentItemName; + disableHandlers = false; + return; + } /* Add textures and palette slot names to ListBoxes */ texturesListBox.Items.AddRange(currentTileset.TexInfo.names.ToArray()); palettesListBox.Items.AddRange(currentTileset.PalInfo.names.ToArray()); + disableHandlers = false; + if (texturesListBox.Items.Count > 0) texturesListBox.SelectedIndex = 0; } diff --git a/DS_Map/Main Window.resx b/DS_Map/Main Window.resx index 9d1c1e3..ed549ba 100644 --- a/DS_Map/Main Window.resx +++ b/DS_Map/Main Window.resx @@ -1158,7 +1158,7 @@ with 'Pokemon DS Map Studio' by Trifindo. AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACA - DwAAAk1TRnQBSQFMAgEBBwEAAXQBCAF0AQgBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DwAAAk1TRnQBSQFMAgEBBwEAAXwBCAF8AQgBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -1297,19 +1297,19 @@ with 'Pokemon DS Map Studio' by Trifindo. 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 AAAASUVORK5CYII=