From 1e5627f8d51f6dfd6f29d4e4e8201c9691ea29e7 Mon Sep 17 00:00:00 2001 From: AdAstra-LD Date: Thu, 8 Apr 2021 10:27:42 +0200 Subject: [PATCH] Updated script editor and other things - Add NSBTX and Remove NSBTX buttons also add/remove building configuration file [NSBTX Editor] - Changed format of Script Editor display - Added highlighting of 'Script', 'Function' and 'Action' keywords (only upon reloading) - Changed Endcodes database to HashSet (PokeDatabase -> ScriptEditor) - Minor refactor --- DS_Map/Main Window.Designer.cs | 466 ++++++++++++++++--------------- DS_Map/Main Window.cs | 110 ++++---- DS_Map/Main Window.resx | 2 +- DS_Map/ROMFiles/RomFile.cs | 1 + DS_Map/ROMFiles/ScriptAction.cs | 2 +- DS_Map/ROMFiles/ScriptCommand.cs | 6 +- DS_Map/ROMFiles/ScriptFile.cs | 52 ++-- DS_Map/Resources/PokeDatabase.cs | 4 +- 8 files changed, 337 insertions(+), 306 deletions(-) diff --git a/DS_Map/Main Window.Designer.cs b/DS_Map/Main Window.Designer.cs index f54cafa..52bb186 100644 --- a/DS_Map/Main Window.Designer.cs +++ b/DS_Map/Main Window.Designer.cs @@ -176,8 +176,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(); @@ -210,8 +213,8 @@ this.zSizeLabel = new System.Windows.Forms.Label(); this.buildingHeightUpDown = new System.Windows.Forms.NumericUpDown(); this.label23 = new System.Windows.Forms.Label(); - this.buildingLengthUpDown = new System.Windows.Forms.NumericUpDown(); this.buildingWidthUpDown = new System.Windows.Forms.NumericUpDown(); + this.buildingLengthUpDown = new System.Windows.Forms.NumericUpDown(); this.duplicateBuildingButton = new System.Windows.Forms.Button(); this.importBuildingsButton = new System.Windows.Forms.Button(); this.exportBuildingsButton = new System.Windows.Forms.Button(); @@ -222,8 +225,8 @@ this.zLabel = new System.Windows.Forms.Label(); this.xLabel = new System.Windows.Forms.Label(); this.yBuildUpDown = new System.Windows.Forms.NumericUpDown(); - this.zBuildUpDown = new System.Windows.Forms.NumericUpDown(); this.xBuildUpDown = new System.Windows.Forms.NumericUpDown(); + this.zBuildUpDown = new System.Windows.Forms.NumericUpDown(); this.buildingsListBox = new System.Windows.Forms.ListBox(); this.permissionsTabPage = new System.Windows.Forms.TabPage(); this.clearCurrentButton = new System.Windows.Forms.Button(); @@ -484,7 +487,7 @@ this.functionTextBox = new System.Windows.Forms.RichTextBox(); this.LineNumberTextBoxFunc = new System.Windows.Forms.RichTextBox(); this.movementTabPage = new System.Windows.Forms.TabPage(); - this.movementTextBox = new System.Windows.Forms.RichTextBox(); + this.actionsTextBox = new System.Windows.Forms.RichTextBox(); this.LineNumberTextBoxMov = new System.Windows.Forms.RichTextBox(); this.scriptCommandsTabControl = new System.Windows.Forms.TabControl(); this.commonScriptsTabPage = new System.Windows.Forms.TabPage(); @@ -628,9 +631,6 @@ this.spawnEditorToolStripButton = 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(); @@ -661,8 +661,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(); @@ -673,12 +676,12 @@ this.groupBox20.SuspendLayout(); this.groupBox19.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.buildingHeightUpDown)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.buildingLengthUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.buildingWidthUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.buildingLengthUpDown)).BeginInit(); this.buildPositionGroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.yBuildUpDown)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.zBuildUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xBuildUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.zBuildUpDown)).BeginInit(); this.permissionsTabPage.SuspendLayout(); this.typeGroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.typePainterUpDown)).BeginInit(); @@ -788,9 +791,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 @@ -2342,6 +2342,63 @@ 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; + dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.headersGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle31; + 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; + dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle32.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.headersGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle32; + this.headersGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle33.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle33.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle33.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle33.Format = "D4"; + dataGridViewCellStyle33.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle33.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.headersGridView.DefaultCellStyle = dataGridViewCellStyle33; + this.headersGridView.Location = new System.Drawing.Point(0, 0); + this.headersGridView.MultiSelect = false; + this.headersGridView.Name = "headersGridView"; + dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle34.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle34.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle34.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle34.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle34.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle34.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.headersGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle34; + this.headersGridView.RowHeadersWidth = 50; + this.headersGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle35.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.headersGridView.RowsDefaultCellStyle = dataGridViewCellStyle35; + 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, 597); + 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); @@ -2352,6 +2409,61 @@ 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; + dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.heightsGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle36; + 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; + dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle37.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle37.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle37.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle37.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle37.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle37.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.heightsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle37; + this.heightsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle38.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle38.Font = new System.Drawing.Font("Tahoma", 8.25F); + dataGridViewCellStyle38.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle38.Format = "D2"; + dataGridViewCellStyle38.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle38.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.heightsGridView.DefaultCellStyle = dataGridViewCellStyle38; + this.heightsGridView.Location = new System.Drawing.Point(0, 0); + this.heightsGridView.MultiSelect = false; + this.heightsGridView.Name = "heightsGridView"; + dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle39.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle39.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle39.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle39.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle39.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.heightsGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle39; + this.heightsGridView.RowHeadersWidth = 50; + this.heightsGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle40.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.heightsGridView.RowsDefaultCellStyle = dataGridViewCellStyle40; + 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, 576); + 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); @@ -2362,6 +2474,62 @@ 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; + dataGridViewCellStyle41.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.mapFilesGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle41; + 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; + dataGridViewCellStyle42.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle42.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle42.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle42.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle42.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle42.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle42.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mapFilesGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle42; + this.mapFilesGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewCellStyle43.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle43.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle43.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle43.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle43.Format = "D4"; + dataGridViewCellStyle43.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle43.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle43.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.mapFilesGridView.DefaultCellStyle = dataGridViewCellStyle43; + this.mapFilesGridView.Location = new System.Drawing.Point(0, 0); + this.mapFilesGridView.MultiSelect = false; + this.mapFilesGridView.Name = "mapFilesGridView"; + dataGridViewCellStyle44.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle44.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle44.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); + dataGridViewCellStyle44.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle44.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle44.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle44.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mapFilesGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle44; + this.mapFilesGridView.RowHeadersWidth = 50; + this.mapFilesGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + dataGridViewCellStyle45.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle45.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.mapFilesGridView.RowsDefaultCellStyle = dataGridViewCellStyle45; + 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, 576); + 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); @@ -2775,14 +2943,6 @@ this.label23.TabIndex = 8; this.label23.Text = "X"; // - // buildingLengthUpDown - // - this.buildingLengthUpDown.Location = new System.Drawing.Point(22, 93); - this.buildingLengthUpDown.Name = "buildingLengthUpDown"; - this.buildingLengthUpDown.Size = new System.Drawing.Size(69, 20); - this.buildingLengthUpDown.TabIndex = 23; - this.buildingLengthUpDown.ValueChanged += new System.EventHandler(this.buildingLengthUpDown_ValueChanged); - // // buildingWidthUpDown // this.buildingWidthUpDown.Location = new System.Drawing.Point(22, 20); @@ -2791,6 +2951,14 @@ this.buildingWidthUpDown.TabIndex = 22; this.buildingWidthUpDown.ValueChanged += new System.EventHandler(this.buildingWidthUpDown_ValueChanged); // + // buildingLengthUpDown + // + this.buildingLengthUpDown.Location = new System.Drawing.Point(22, 93); + this.buildingLengthUpDown.Name = "buildingLengthUpDown"; + this.buildingLengthUpDown.Size = new System.Drawing.Size(69, 20); + this.buildingLengthUpDown.TabIndex = 23; + this.buildingLengthUpDown.ValueChanged += new System.EventHandler(this.buildingLengthUpDown_ValueChanged); + // // duplicateBuildingButton // this.duplicateBuildingButton.Image = global::DSPRE.Properties.Resources.copyIcon_small; @@ -2904,7 +3072,7 @@ this.xLabel.TabIndex = 8; this.xLabel.Text = "X"; // - // zBuildUpDown + // yBuildUpDown // this.yBuildUpDown.DecimalPlaces = 4; this.yBuildUpDown.Location = new System.Drawing.Point(22, 56); @@ -2918,30 +3086,11 @@ 0, 0, -2147483648}); - this.yBuildUpDown.Name = "zBuildUpDown"; + this.yBuildUpDown.Name = "yBuildUpDown"; this.yBuildUpDown.Size = new System.Drawing.Size(69, 20); this.yBuildUpDown.TabIndex = 7; this.yBuildUpDown.ValueChanged += new System.EventHandler(this.yBuildUpDown_ValueChanged); // - // yBuildUpDown - // - this.zBuildUpDown.DecimalPlaces = 4; - this.zBuildUpDown.Location = new System.Drawing.Point(22, 93); - this.zBuildUpDown.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.zBuildUpDown.Minimum = new decimal(new int[] { - 255, - 0, - 0, - -2147483648}); - this.zBuildUpDown.Name = "yBuildUpDown"; - this.zBuildUpDown.Size = new System.Drawing.Size(69, 20); - this.zBuildUpDown.TabIndex = 6; - this.zBuildUpDown.ValueChanged += new System.EventHandler(this.zBuildUpDown_ValueChanged); - // // xBuildUpDown // this.xBuildUpDown.DecimalPlaces = 4; @@ -2961,6 +3110,25 @@ this.xBuildUpDown.TabIndex = 5; this.xBuildUpDown.ValueChanged += new System.EventHandler(this.xBuildUpDown_ValueChanged); // + // zBuildUpDown + // + this.zBuildUpDown.DecimalPlaces = 4; + this.zBuildUpDown.Location = new System.Drawing.Point(22, 93); + this.zBuildUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.zBuildUpDown.Minimum = new decimal(new int[] { + 255, + 0, + 0, + -2147483648}); + this.zBuildUpDown.Name = "zBuildUpDown"; + this.zBuildUpDown.Size = new System.Drawing.Size(69, 20); + this.zBuildUpDown.TabIndex = 6; + this.zBuildUpDown.ValueChanged += new System.EventHandler(this.zBuildUpDown_ValueChanged); + // // buildingsListBox // this.buildingsListBox.FormattingEnabled = true; @@ -6101,6 +6269,7 @@ // // scriptTextBox // + this.scriptTextBox.AcceptsTab = true; this.scriptTextBox.BackColor = System.Drawing.SystemColors.Menu; this.scriptTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.scriptTextBox.Dock = System.Windows.Forms.DockStyle.Fill; @@ -6111,6 +6280,7 @@ this.scriptTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; this.scriptTextBox.Size = new System.Drawing.Size(581, 562); this.scriptTextBox.TabIndex = 7; + this.scriptTextBox.TabStop = false; this.scriptTextBox.Text = ""; this.scriptTextBox.SelectionChanged += new System.EventHandler(this.updateCurrentBoxLineNumbers); this.scriptTextBox.VScroll += new System.EventHandler(this.updateCurrentBoxLineNumbers); @@ -6150,6 +6320,7 @@ // // functionTextBox // + this.functionTextBox.AcceptsTab = true; this.functionTextBox.BackColor = System.Drawing.SystemColors.Menu; this.functionTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.functionTextBox.Dock = System.Windows.Forms.DockStyle.Fill; @@ -6160,6 +6331,7 @@ this.functionTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; this.functionTextBox.Size = new System.Drawing.Size(581, 562); this.functionTextBox.TabIndex = 14; + this.functionTextBox.TabStop = false; this.functionTextBox.Text = ""; this.functionTextBox.VScroll += new System.EventHandler(this.updateCurrentBoxLineNumbers); this.functionTextBox.TextChanged += new System.EventHandler(this.updateCurrentBoxLineNumbers); @@ -6184,31 +6356,33 @@ // // movementTabPage // - this.movementTabPage.Controls.Add(this.movementTextBox); + this.movementTabPage.Controls.Add(this.actionsTextBox); this.movementTabPage.Controls.Add(this.LineNumberTextBoxMov); this.movementTabPage.Location = new System.Drawing.Point(4, 22); this.movementTabPage.Name = "movementTabPage"; this.movementTabPage.Padding = new System.Windows.Forms.Padding(3); this.movementTabPage.Size = new System.Drawing.Size(597, 568); this.movementTabPage.TabIndex = 2; - this.movementTabPage.Text = "Movements and Actions"; + this.movementTabPage.Text = "Actions"; this.movementTabPage.UseVisualStyleBackColor = true; // - // movementTextBox + // actionsTextBox // - this.movementTextBox.BackColor = System.Drawing.SystemColors.Menu; - this.movementTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.movementTextBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.movementTextBox.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.movementTextBox.Location = new System.Drawing.Point(13, 3); - this.movementTextBox.MaxLength = 1000000; - this.movementTextBox.Name = "movementTextBox"; - this.movementTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; - this.movementTextBox.Size = new System.Drawing.Size(581, 562); - this.movementTextBox.TabIndex = 17; - this.movementTextBox.Text = ""; - this.movementTextBox.SelectionChanged += new System.EventHandler(this.updateCurrentBoxLineNumbers); - this.movementTextBox.VScroll += new System.EventHandler(this.updateCurrentBoxLineNumbers); + this.actionsTextBox.AcceptsTab = true; + this.actionsTextBox.BackColor = System.Drawing.SystemColors.Menu; + this.actionsTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.actionsTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.actionsTextBox.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.actionsTextBox.Location = new System.Drawing.Point(13, 3); + this.actionsTextBox.MaxLength = 1000000; + this.actionsTextBox.Name = "actionsTextBox"; + this.actionsTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; + this.actionsTextBox.Size = new System.Drawing.Size(581, 562); + this.actionsTextBox.TabIndex = 17; + this.actionsTextBox.TabStop = false; + this.actionsTextBox.Text = ""; + this.actionsTextBox.SelectionChanged += new System.EventHandler(this.updateCurrentBoxLineNumbers); + this.actionsTextBox.VScroll += new System.EventHandler(this.updateCurrentBoxLineNumbers); // // LineNumberTextBoxMov // @@ -7835,174 +8009,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; - dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.headersGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle31; - 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; - dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle32.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.headersGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle32; - this.headersGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle33.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle33.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle33.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle33.Format = "D4"; - dataGridViewCellStyle33.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle33.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.headersGridView.DefaultCellStyle = dataGridViewCellStyle33; - this.headersGridView.Location = new System.Drawing.Point(0, 0); - this.headersGridView.MultiSelect = false; - this.headersGridView.Name = "headersGridView"; - dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle34.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle34.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle34.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle34.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle34.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle34.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.headersGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle34; - this.headersGridView.RowHeadersWidth = 50; - this.headersGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle35.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.headersGridView.RowsDefaultCellStyle = dataGridViewCellStyle35; - 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, 597); - 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; - dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.heightsGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle36; - 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; - dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle37.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle37.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle37.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle37.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle37.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle37.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.heightsGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle37; - this.heightsGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle38.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle38.Font = new System.Drawing.Font("Tahoma", 8.25F); - dataGridViewCellStyle38.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle38.Format = "D2"; - dataGridViewCellStyle38.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle38.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.heightsGridView.DefaultCellStyle = dataGridViewCellStyle38; - this.heightsGridView.Location = new System.Drawing.Point(0, 0); - this.heightsGridView.MultiSelect = false; - this.heightsGridView.Name = "heightsGridView"; - dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle39.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle39.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle39.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle39.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle39.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.heightsGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle39; - this.heightsGridView.RowHeadersWidth = 50; - this.heightsGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle40.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.heightsGridView.RowsDefaultCellStyle = dataGridViewCellStyle40; - 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, 576); - 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; - dataGridViewCellStyle41.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.mapFilesGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle41; - 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; - dataGridViewCellStyle42.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle42.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle42.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle42.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle42.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle42.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle42.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.mapFilesGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle42; - this.mapFilesGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle43.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle43.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle43.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle43.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle43.Format = "D4"; - dataGridViewCellStyle43.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle43.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle43.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.mapFilesGridView.DefaultCellStyle = dataGridViewCellStyle43; - this.mapFilesGridView.Location = new System.Drawing.Point(0, 0); - this.mapFilesGridView.MultiSelect = false; - this.mapFilesGridView.Name = "mapFilesGridView"; - dataGridViewCellStyle44.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle44.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle44.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F); - dataGridViewCellStyle44.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle44.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle44.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle44.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.mapFilesGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle44; - this.mapFilesGridView.RowHeadersWidth = 50; - this.mapFilesGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle45.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle45.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.mapFilesGridView.RowsDefaultCellStyle = dataGridViewCellStyle45; - 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, 576); - 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.AllowDrop = true; @@ -8064,8 +8070,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); @@ -8079,13 +8088,13 @@ this.groupBox19.ResumeLayout(false); this.groupBox19.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.buildingHeightUpDown)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.buildingLengthUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.buildingWidthUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.buildingLengthUpDown)).EndInit(); this.buildPositionGroupBox.ResumeLayout(false); this.buildPositionGroupBox.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.yBuildUpDown)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.zBuildUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xBuildUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.zBuildUpDown)).EndInit(); this.permissionsTabPage.ResumeLayout(false); this.permissionsTabPage.PerformLayout(); this.typeGroupBox.ResumeLayout(false); @@ -8229,9 +8238,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(); @@ -8420,7 +8426,7 @@ private System.Windows.Forms.Button importMatrixButton; private System.Windows.Forms.Button exportMatrixButton; private System.Windows.Forms.RichTextBox functionTextBox; - private System.Windows.Forms.RichTextBox movementTextBox; + private System.Windows.Forms.RichTextBox actionsTextBox; private System.Windows.Forms.Button setVarButton; private System.Windows.Forms.Button jumpToFuncButton; private System.Windows.Forms.Button callFunctionButton; diff --git a/DS_Map/Main Window.cs b/DS_Map/Main Window.cs index 66b6057..db24463 100644 --- a/DS_Map/Main Window.cs +++ b/DS_Map/Main Window.cs @@ -524,6 +524,7 @@ namespace DSPRE { DirNames.buildingTextures, DirNames.mapTextures, DirNames.areaData, + DirNames.buildingConfigFiles }, toolStripProgressBar); /* Fill Tileset ListBox */ @@ -5037,7 +5038,7 @@ namespace DSPRE { currentScriptBox = functionTextBox; currentLineNumbersBox = LineNumberTextBoxFunc; } else if (scriptEditorTabControl.SelectedIndex == 2) { - currentScriptBox = movementTextBox; + currentScriptBox = actionsTextBox; currentLineNumbersBox = LineNumberTextBoxMov; } else { currentScriptBox = null; @@ -5111,7 +5112,7 @@ namespace DSPRE { private void saveScriptFileButton_Click(object sender, EventArgs e) { /* Create new ScriptFile object */ int idToAssign = selectScriptFileComboBox.SelectedIndex; - ScriptFile userEdited = new ScriptFile(scriptTextBox.Lines, functionTextBox.Lines, movementTextBox.Lines, selectScriptFileComboBox.SelectedIndex); + ScriptFile userEdited = new ScriptFile(scriptTextBox.Lines, functionTextBox.Lines, actionsTextBox.Lines, selectScriptFileComboBox.SelectedIndex); /* Write new scripts to file */ if (userEdited.fileID == idToAssign) { //check if ScriptFile instance was created succesfully @@ -5223,12 +5224,12 @@ namespace DSPRE { if (split[3].StartsWith("Script")) { if (scriptEditorTabControl.SelectedIndex != 0) scriptEditorTabControl.SelectedIndex = 0; - int keywordPos = scriptTextBox.Find("@Script_#" + split[4].Replace(":", ""), RichTextBoxFinds.MatchCase); + int keywordPos = scriptTextBox.Find("Script " + split[4].Replace(":", ""), RichTextBoxFinds.MatchCase); TXTBoxScrollToResult(scriptTextBox, cmdSearched, keywordPos); } else if (split[3].StartsWith("Function")) { if (scriptEditorTabControl.SelectedIndex != 1) scriptEditorTabControl.SelectedIndex = 1; - int keywordPos = functionTextBox.Find("@Function_#" + split[4].Replace(":", ""), RichTextBoxFinds.MatchCase); + int keywordPos = functionTextBox.Find("Function " + split[4].Replace(":", ""), RichTextBoxFinds.MatchCase); TXTBoxScrollToResult(functionTextBox, cmdSearched, keywordPos); } } @@ -5261,75 +5262,90 @@ namespace DSPRE { scriptTextBox.Clear(); functionTextBox.Clear(); - movementTextBox.Clear(); + actionsTextBox.Clear(); if (currentScriptFile.isLevelScript) { scriptTextBox.Text += "Level script files are currently not supported.\nYou can use AdAstra's Level Scripts Editor."; } else { - /* Add scripts */ disableHandlers = true; - string buffer = ""; + + /* Add scripts */ + Color headerTextColor = Color.FromArgb(210, 0, 0); + + Color scriptTextColor = Color.FromArgb(0, 100, 0); + Color funcTextColor = Color.FromArgb(0, 0, 100); + Color actionTextColor = Color.FromArgb(100, 0, 0); for (int i = 0; i < currentScriptFile.allScripts.Count; i++) { CommandContainer currentScript = currentScriptFile.allScripts[i]; /* Write header */ - string scrHeader = "----- " + "@Script_#" + (i + 1) + " -----" + Environment.NewLine; - buffer += scrHeader; - buffer += Environment.NewLine; + scriptTextBox.AppendText("Script " + (i + 1) + ':' + Environment.NewLine, headerTextColor); /* If current script is identical to another, print UseScript instead of commands */ if (currentScript.useScript < 0) { - for (int j = 0; j < currentScript.commands.Count; j++) + for (int j = 0; j < currentScript.commands.Count; j++) { + if (!PokeDatabase.ScriptEditor.endCodes.Contains(currentScript.commands[j].id)) { + buffer += '\t'; + } buffer += currentScript.commands[j].name + Environment.NewLine; + } } else { - buffer += ("UseScript_#" + currentScript.useScript + Environment.NewLine); + buffer += '\t' + "UseScript_#" + currentScript.useScript + Environment.NewLine; } + + scriptTextBox.AppendText(buffer + Environment.NewLine, scriptTextColor); + buffer = ""; } - scriptTextBox.AppendText(buffer + Environment.NewLine, Color.FromArgb(0, 140, 0)); - buffer = ""; + /* Add functions */ for (int i = 0; i < currentScriptFile.allFunctions.Count; i++) { CommandContainer currentFunction = currentScriptFile.allFunctions[i]; /* Write Heaader */ - string funcHeader = "----- " + "@Function_#" + (i + 1) + " -----" + Environment.NewLine; - buffer += funcHeader; - buffer += Environment.NewLine; + functionTextBox.AppendText("Function " + (i + 1) + ':' + Environment.NewLine, headerTextColor); /* If current function is identical to a script, print UseScript instead of commands */ if (currentFunction.useScript < 0) { - for (int j = 0; j < currentFunction.commands.Count; j++) + for (int j = 0; j < currentFunction.commands.Count; j++) { + if(!PokeDatabase.ScriptEditor.endCodes.Contains(currentFunction.commands[j].id)) { + buffer += '\t'; + } buffer += currentFunction.commands[j].name + Environment.NewLine; + } } else { - buffer += ("UseScript_#" + currentFunction.useScript + Environment.NewLine); + buffer += '\t' + "UseScript_#" + currentFunction.useScript + Environment.NewLine; } + functionTextBox.AppendText(buffer + Environment.NewLine, funcTextColor); + buffer = ""; } - functionTextBox.AppendText(buffer + Environment.NewLine, Color.Blue); - buffer = ""; /* Add movements */ for (int i = 0; i < currentScriptFile.allActions.Count; i++) { ActionContainer currentAction = currentScriptFile.allActions[i]; - string movHeader = "----- " + "@Action_#" + (i + 1) + " -----" + Environment.NewLine; - buffer += movHeader; - buffer += Environment.NewLine; - for (int j = 0; j < currentAction.actionCommandsList.Count; j++) + actionsTextBox.AppendText("Action " + (i + 1) + ':' + Environment.NewLine, headerTextColor); + + for (int j = 0; j < currentAction.actionCommandsList.Count; j++) { + if (currentAction.actionCommandsList[j].id != 0x00FE) { + buffer += '\t'; + } buffer += currentAction.actionCommandsList[j].name + Environment.NewLine; + } + + actionsTextBox.AppendText(buffer + Environment.NewLine, actionTextColor); + buffer = ""; } - movementTextBox.AppendText(buffer + Environment.NewLine, Color.FromArgb(192, 40, 40)); - buffer = ""; } statusLabel.Text = "Ready"; disableHandlers = false; UpdateLineNumbers(scriptTextBox, LineNumberTextBoxScript); UpdateLineNumbers(functionTextBox, LineNumberTextBoxFunc); - UpdateLineNumbers(movementTextBox, LineNumberTextBoxMov); + UpdateLineNumbers(actionsTextBox, LineNumberTextBoxMov); } #region Script Macros @@ -6045,12 +6061,12 @@ namespace DSPRE { if (sf.ShowDialog(this) != DialogResult.OK) return; - string tilesetPath; - if (mapTilesetRadioButton.Checked) - tilesetPath = RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); - else - tilesetPath = RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); + string tilesetPath = mapTilesetRadioButton.Checked + ? RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4") + : RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); File.Copy(tilesetPath, sf.FileName); + + MessageBox.Show("NSBTX tileset exported successfully!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void importNSBTXButton_Click(object sender, EventArgs e) { /* Prompt user to select .nsbtx file */ @@ -6060,16 +6076,15 @@ namespace DSPRE { return; /* Update nsbtx file */ - string tilesetPath; - if (mapTilesetRadioButton.Checked) - tilesetPath = RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); - else - tilesetPath = RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); + string tilesetPath = mapTilesetRadioButton.Checked + ? RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4") + : RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); File.Copy(ofd.FileName, tilesetPath, true); /* Update nsbtx object in memory and controls */ currentTileset = new NSMBe4.NSBMD.NSBTX_File(new FileStream(ofd.FileName, FileMode.Open)); - + texturePacksListBox_SelectedIndexChanged(null, null); + MessageBox.Show("NSBTX tileset imported successfully!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void mapTilesetRadioButton_CheckedChanged(object sender, EventArgs e) { FillTilesetBox(); @@ -6101,19 +6116,18 @@ namespace DSPRE { palettesListBox.Items.Clear(); /* Load tileset file */ - string tilesetPath; - if (mapTilesetRadioButton.Checked) { - tilesetPath = RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); - } else { - tilesetPath = RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); - } + string tilesetPath = mapTilesetRadioButton.Checked + ? RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4") + : RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + texturePacksListBox.SelectedIndex.ToString("D4"); 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!")) + if (!currentItemName.StartsWith("Error!")) { texturePacksListBox.Items[texturePacksListBox.SelectedIndex] = "Error! - " + currentItemName; + } + disableHandlers = false; return; } @@ -6227,8 +6241,9 @@ namespace DSPRE { File.Copy(RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + 0.ToString("D4"), RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + texturePacksListBox.Items.Count.ToString("D4")); } else { File.Copy(RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + 0.ToString("D4"), RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + texturePacksListBox.Items.Count.ToString("D4")); + File.Copy(RomInfo.gameDirs[DirNames.buildingConfigFiles].unpackedDir + "\\" + 0.ToString("D4"), RomInfo.gameDirs[DirNames.buildingConfigFiles].unpackedDir + "\\" + texturePacksListBox.Items.Count.ToString("D4")); } - + /* Update ComboBox and select new file */ texturePacksListBox.Items.Add("Texture Pack " + texturePacksListBox.Items.Count); texturePacksListBox.SelectedIndex = texturePacksListBox.Items.Count - 1; @@ -6240,6 +6255,7 @@ namespace DSPRE { File.Delete(RomInfo.gameDirs[DirNames.mapTextures].unpackedDir + "\\" + (texturePacksListBox.Items.Count - 1).ToString("D4")); else { File.Delete(RomInfo.gameDirs[DirNames.buildingTextures].unpackedDir + "\\" + (texturePacksListBox.Items.Count - 1).ToString("D4")); + File.Delete(RomInfo.gameDirs[DirNames.buildingConfigFiles].unpackedDir + "\\" + (texturePacksListBox.Items.Count - 1).ToString("D4")); } /* Check if currently selected file is the last one, and in that case select the one before it */ diff --git a/DS_Map/Main Window.resx b/DS_Map/Main Window.resx index 90da802..4b3a65f 100644 --- a/DS_Map/Main Window.resx +++ b/DS_Map/Main Window.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk - EAAAAk1TRnQBSQFMAgEBCAEAATQBDwE0AQ8BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + EAAAAk1TRnQBSQFMAgEBCAEAAUQBDwFEAQ8BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/DS_Map/ROMFiles/RomFile.cs b/DS_Map/ROMFiles/RomFile.cs index dfc367a..3fa28d0 100644 --- a/DS_Map/ROMFiles/RomFile.cs +++ b/DS_Map/ROMFiles/RomFile.cs @@ -7,6 +7,7 @@ namespace DSPRE.ROMFiles { public abstract class RomFile { public abstract byte[] ToByteArray(); public void SaveToFile(string path, bool showSuccessMessage = true) { + byte[] romFileToByteArray = ToByteArray(); if (romFileToByteArray == null) { Console.WriteLine(GetType().Name + " couldn't be saved!"); diff --git a/DS_Map/ROMFiles/ScriptAction.cs b/DS_Map/ROMFiles/ScriptAction.cs index 8449db5..2d1ce05 100644 --- a/DS_Map/ROMFiles/ScriptAction.cs +++ b/DS_Map/ROMFiles/ScriptAction.cs @@ -38,7 +38,7 @@ namespace DSPRE.ROMFiles { public ScriptAction(string wholeLine, int lineNumber) { name = wholeLine; - string[] nameParts = wholeLine.Split(' '); // Separate command code from parameters + string[] nameParts = wholeLine.Replace("\t", "").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); // Separate command code from parameters /* Get command id, which is always first in the description */ try { diff --git a/DS_Map/ROMFiles/ScriptCommand.cs b/DS_Map/ROMFiles/ScriptCommand.cs index a9079a7..2cb1ede 100644 --- a/DS_Map/ROMFiles/ScriptCommand.cs +++ b/DS_Map/ROMFiles/ScriptCommand.cs @@ -12,6 +12,7 @@ namespace DSPRE.ROMFiles { public uint manualUserID; public int useScript; public containerTypes containerType; + internal static readonly string functionStart; #region Constructors (2) public CommandContainer(uint scriptNumber, containerTypes containerType, int useScript = -1, List commandList = null) { @@ -93,7 +94,7 @@ namespace DSPRE.ROMFiles { name = wholeLine; cmdParams = new List(); - string[] nameParts = wholeLine.Split(' '); // Separate command code from parameters + string[] nameParts = wholeLine.Replace("\t", "").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); // Separate command code from parameters /* Get command id, which is always first in the description */ try { @@ -170,6 +171,9 @@ namespace DSPRE.ROMFiles { } catch (FormatException) { MessageBox.Show("Argument " + '"' + nameParts[i + 1] + '"' + " at line " + lineNumber + " is not a valid number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); id = null; + } catch (OverflowException) { + MessageBox.Show("Argument " + '"' + nameParts[i + 1] + '"' + " at line " + lineNumber + " is not in the range [" + byte.MinValue + ", " + byte.MaxValue + "].", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + id = null; } } } diff --git a/DS_Map/ROMFiles/ScriptFile.cs b/DS_Map/ROMFiles/ScriptFile.cs index d5c5d4c..404534b 100644 --- a/DS_Map/ROMFiles/ScriptFile.cs +++ b/DS_Map/ROMFiles/ScriptFile.cs @@ -143,14 +143,16 @@ namespace DSPRE.ROMFiles { //TODO: give user the possibility to jump to/call a script //once it's done, this Predicate below will be the only one needed, since there will be no distinction between //a script and a function - Func functionEndCondition = - (source, x) => source[x].TrimEnd().Equals(RomInfo.ScriptCommandNamesDict[0x0002], StringComparison.InvariantCultureIgnoreCase) //End + Func functionEndCondition = + (source, x, id) => source[x].TrimEnd().Equals(RomInfo.ScriptCommandNamesDict[0x0002], StringComparison.InvariantCultureIgnoreCase) //End || source[x].IndexOf(RomInfo.ScriptCommandNamesDict[0x0016] + " Function", StringComparison.InvariantCultureIgnoreCase) >= 0 //Jump Function_# - || source[x].TrimEnd().Equals(RomInfo.ScriptCommandNamesDict[0x001B], StringComparison.InvariantCultureIgnoreCase); //Return + || source[x].TrimEnd().Equals(RomInfo.ScriptCommandNamesDict[0x001B], StringComparison.InvariantCultureIgnoreCase) + || PokeDatabase.ScriptEditor.endCodes.Contains(id); //Return - Func scriptEndCondition = - (source, x) => source[x].TrimEnd().Equals(RomInfo.ScriptCommandNamesDict[0x0002], StringComparison.InvariantCultureIgnoreCase) //End - || source[x].IndexOf(RomInfo.ScriptCommandNamesDict[0x0016] + " Function") >= 0; //Jump Function_# + Func scriptEndCondition = + (source, x, id) => source[x].TrimEnd().Equals(RomInfo.ScriptCommandNamesDict[0x0002], StringComparison.InvariantCultureIgnoreCase) //End + || source[x].IndexOf(RomInfo.ScriptCommandNamesDict[0x0016] + " Function") >= 0 //Jump Function_# + || PokeDatabase.ScriptEditor.endCodes.Contains(id); allScripts = ReadCommandsFromLines(scriptLines, containerTypes.SCRIPT, scriptEndCondition); //Jump + whitespace if (allScripts == null || allScripts.Count <= 0) @@ -449,18 +451,19 @@ namespace DSPRE.ROMFiles { references.Add(new ScriptReference(cont.containerType, cont.manualUserID, containerTypes.FUNCTION, invokedID, pos - 4)); } } - private List ReadCommandsFromLines(string[] lineSource, containerTypes containerType, Func endConditions) { + private List ReadCommandsFromLines(string[] lineSource, containerTypes containerType, Func endConditions) { List ls = new List(); try { for (int i = 0; i < lineSource.Length; i++) { - int positionOfScriptNumber = lineSource[i].IndexOf('#'); - if (lineSource[i].Contains('@') && positionOfScriptNumber >= 0) { // Move on until script header is found - uint scriptNumber = uint.Parse(lineSource[i].Substring(positionOfScriptNumber + 1).Split()[0].Replace("-", "")); + int positionOfScriptNumber = lineSource[i].IndexOfAny("0123456789".ToCharArray()); + if (positionOfScriptNumber >= 0) { // Move on until script header is found + uint scriptNumber = uint.Parse(lineSource[i].Substring(positionOfScriptNumber).Split()[0].Replace(":", "")); i++; - while (lineSource[i].Length <= 0) + while (lineSource[i].Length <= 0) { i++; //Skip all empty lines + } if (lineSource[i].IndexOf("UseScript", StringComparison.InvariantCultureIgnoreCase) >= 0) { int useScriptNumber = Int16.Parse(lineSource[i].Substring(1 + lineSource[i].IndexOf('#'))); @@ -469,15 +472,15 @@ namespace DSPRE.ROMFiles { /* Read script commands */ List cmdList = new List(); - while (!endConditions(lineSource, i)) { - ScriptCommand toAdd = new ScriptCommand(lineSource[i], i + 1); - if (toAdd.id == null) + ScriptCommand lastRead; + do { + lastRead = new ScriptCommand(lineSource[i], i + 1); + if (lastRead.id == null) return null; - cmdList.Add(toAdd); - i++; - } - cmdList.Add(new ScriptCommand(lineSource[i], i + 1)); // Add end or jump/call command + cmdList.Add(lastRead); + } while (!endConditions(lineSource, i++, lastRead.id)); + ls.Add(new CommandContainer(scriptNumber, containerType, commandList: cmdList)); } } @@ -490,9 +493,9 @@ namespace DSPRE.ROMFiles { try { for (int i = 0; i < lineSource.Length; i++) { - int positionOfActionNumber = lineSource[i].IndexOf('#'); - if (lineSource[i].Contains('@') && positionOfActionNumber >= 0) { // Move on until script header is found - uint actionNumber = uint.Parse(lineSource[i].Substring(positionOfActionNumber + 1).Split()[0].Replace("-", "")); + int positionOfActionNumber = lineSource[i].IndexOfAny("0123456789".ToCharArray()); + if (positionOfActionNumber >= 0) { // Move on until script header is found + uint actionNumber = uint.Parse(lineSource[i].Substring(positionOfActionNumber).Split()[0].Replace(":", "")); i++; while (lineSource[i].Length <= 0) @@ -500,15 +503,13 @@ namespace DSPRE.ROMFiles { List cmdList = new List(); /* Read script commands */ - while (!lineSource[i].Equals(PokeDatabase.ScriptEditor.movementsDictIDName[0x00FE], StringComparison.InvariantCultureIgnoreCase)) { //End + do { ScriptAction toAdd = new ScriptAction(lineSource[i], i + 1); if (toAdd.id == null) return null; cmdList.Add(toAdd); - i++; - } - cmdList.Add(new ScriptAction(lineSource[i], i + 1)); // Read and add end command + } while (!lineSource[i++].Equals(PokeDatabase.ScriptEditor.movementsDictIDName[0x00FE], StringComparison.InvariantCultureIgnoreCase)); ls.Add(new ActionContainer(actionNumber, actionCommandsList: cmdList)); } @@ -587,6 +588,7 @@ namespace DSPRE.ROMFiles { } /* If command calls a function/movement, store reference position */ + AddReference(ref refList, (ushort)currentCmd.id, parameterList, (int)writer.BaseStream.Position, currentFunction); } } else { diff --git a/DS_Map/Resources/PokeDatabase.cs b/DS_Map/Resources/PokeDatabase.cs index 1a71091..3a09dae 100644 --- a/DS_Map/Resources/PokeDatabase.cs +++ b/DS_Map/Resources/PokeDatabase.cs @@ -714,7 +714,7 @@ namespace DSPRE.Resources { [0x001D] = 1, //Call-If [0x005E] = 1, //Movement }; - public static ushort[] endCodes = new ushort[] { + public static HashSet endCodes = new HashSet() { 0x2, 0x16, 0x1B @@ -2473,6 +2473,7 @@ namespace DSPRE.Resources { }; public static Dictionary CustomScrCmdNames = new Dictionary() { + [0x0357] = "DivVar", [0x0360] = "AddCameraMovementParam", [0x0361] = "OverrideDefaultCam", [0x0362] = "ResetCamMovement", @@ -3346,6 +3347,7 @@ namespace DSPRE.Resources { [0x0354] = new byte[] { 1, 1 } }; public static Dictionary CustomScrCmdParameters = new Dictionary() { + [0x0357] = new byte[] { 2, 2 }, [0x0360] = new byte[] { 2, 2, 2, 2 }, [0x0361] = new byte[1] { 0 }, [0x0362] = new byte[1] { 0 },