From 7c405c8ba3266715c9e8040e61a2e637d6af7c41 Mon Sep 17 00:00:00 2001 From: AdAstra-LD <76622070+AdAstra-LD@users.noreply.github.com> Date: Mon, 9 Aug 2021 23:16:42 +0200 Subject: [PATCH] Expanded ScriptCommandDatabase with Action Cmds and Comparison Operators --- DS_Map/Main Window.Designer.cs | 64 +-- DS_Map/Main Window.cs | 18 +- DS_Map/Main Window.resx | 60 +-- DS_Map/ROMFiles/ScriptFile.cs | 2 +- DS_Map/Resources/CommandsDatabase.Designer.cs | 378 +++++++++++++----- DS_Map/Resources/CommandsDatabase.cs | 136 ++++--- DS_Map/Resources/CommandsDatabase.resx | 24 ++ DS_Map/Resources/ScriptDatabase.cs | 7 +- 8 files changed, 478 insertions(+), 211 deletions(-) diff --git a/DS_Map/Main Window.Designer.cs b/DS_Map/Main Window.Designer.cs index d82dc14..cdda520 100644 --- a/DS_Map/Main Window.Designer.cs +++ b/DS_Map/Main Window.Designer.cs @@ -486,11 +486,11 @@ this.importEventFileButton = new System.Windows.Forms.Button(); this.saveEventsButton = new System.Windows.Forms.Button(); this.scriptTabPage = new System.Windows.Forms.TabPage(); + this.scriptEditorWhitespacesCheckbox = new System.Windows.Forms.CheckBox(); + this.scriptEditorWordWrapCheckbox = new System.Windows.Forms.CheckBox(); this.compressScriptTextButton = new System.Windows.Forms.Button(); this.expandScriptTextButton = new System.Windows.Forms.Button(); this.findScriptTextButton = new System.Windows.Forms.Button(); - this.scriptEditorWhitespacesCheckbox = new System.Windows.Forms.CheckBox(); - this.scriptEditorWordWrapCheckbox = new System.Windows.Forms.CheckBox(); this.groupBox24 = new System.Windows.Forms.GroupBox(); this.SyncNavigatorCB = new System.Windows.Forms.CheckBox(); this.ScriptNavigatorTabControl = new System.Windows.Forms.TabControl(); @@ -5189,7 +5189,7 @@ this.isTrainerRadioButton.TabIndex = 16; this.isTrainerRadioButton.Text = "Trainer"; this.isTrainerRadioButton.UseVisualStyleBackColor = true; - this.isTrainerRadioButton.Click += new System.EventHandler(this.OWTypeChanged); + this.isTrainerRadioButton.CheckedChanged += new System.EventHandler(this.OWTypeChanged); // // isItemRadioButton // @@ -5200,7 +5200,7 @@ this.isItemRadioButton.TabIndex = 21; this.isItemRadioButton.Text = "Item"; this.isItemRadioButton.UseVisualStyleBackColor = true; - this.isItemRadioButton.Click += new System.EventHandler(this.OWTypeChanged); + this.isItemRadioButton.CheckedChanged += new System.EventHandler(this.OWTypeChanged); // // spriteIDlabel // @@ -6621,6 +6621,34 @@ this.scriptTabPage.Text = "Script Editor"; this.scriptTabPage.UseVisualStyleBackColor = true; // + // scriptEditorWhitespacesCheckbox + // + this.scriptEditorWhitespacesCheckbox.Appearance = System.Windows.Forms.Appearance.Button; + this.scriptEditorWhitespacesCheckbox.AutoSize = true; + this.scriptEditorWhitespacesCheckbox.Location = new System.Drawing.Point(978, 10); + this.scriptEditorWhitespacesCheckbox.Name = "scriptEditorWhitespacesCheckbox"; + this.scriptEditorWhitespacesCheckbox.Size = new System.Drawing.Size(79, 23); + this.scriptEditorWhitespacesCheckbox.TabIndex = 46; + this.scriptEditorWhitespacesCheckbox.Text = "Whitespaces"; + this.scriptEditorWhitespacesCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.scriptEditorWhitespacesCheckbox.UseVisualStyleBackColor = true; + this.scriptEditorWhitespacesCheckbox.CheckedChanged += new System.EventHandler(this.viewWhiteSpacesButton_Click); + // + // scriptEditorWordWrapCheckbox + // + this.scriptEditorWordWrapCheckbox.Appearance = System.Windows.Forms.Appearance.Button; + this.scriptEditorWordWrapCheckbox.AutoSize = true; + this.scriptEditorWordWrapCheckbox.Checked = true; + this.scriptEditorWordWrapCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; + this.scriptEditorWordWrapCheckbox.Location = new System.Drawing.Point(904, 10); + this.scriptEditorWordWrapCheckbox.Name = "scriptEditorWordWrapCheckbox"; + this.scriptEditorWordWrapCheckbox.Size = new System.Drawing.Size(72, 23); + this.scriptEditorWordWrapCheckbox.TabIndex = 43; + this.scriptEditorWordWrapCheckbox.Text = "Word Wrap"; + this.scriptEditorWordWrapCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.scriptEditorWordWrapCheckbox.UseVisualStyleBackColor = true; + this.scriptEditorWordWrapCheckbox.CheckedChanged += new System.EventHandler(this.scriptEditorWordWrapCheckbox_CheckedChanged); + // // compressScriptTextButton // this.compressScriptTextButton.Image = global::DSPRE.Properties.Resources.compressArrow; @@ -6656,34 +6684,6 @@ this.findScriptTextButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.findScriptTextButton.UseVisualStyleBackColor = true; // - // scriptEditorWhitespacesCheckbox - // - this.scriptEditorWhitespacesCheckbox.Appearance = System.Windows.Forms.Appearance.Button; - this.scriptEditorWhitespacesCheckbox.AutoSize = true; - this.scriptEditorWhitespacesCheckbox.Location = new System.Drawing.Point(978, 10); - this.scriptEditorWhitespacesCheckbox.Name = "scriptEditorWhitespacesCheckbox"; - this.scriptEditorWhitespacesCheckbox.Size = new System.Drawing.Size(79, 23); - this.scriptEditorWhitespacesCheckbox.TabIndex = 46; - this.scriptEditorWhitespacesCheckbox.Text = "Whitespaces"; - this.scriptEditorWhitespacesCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.scriptEditorWhitespacesCheckbox.UseVisualStyleBackColor = true; - this.scriptEditorWhitespacesCheckbox.CheckedChanged += new System.EventHandler(this.viewWhiteSpacesButton_Click); - // - // scriptEditorWordWrapCheckbox - // - this.scriptEditorWordWrapCheckbox.Appearance = System.Windows.Forms.Appearance.Button; - this.scriptEditorWordWrapCheckbox.AutoSize = true; - this.scriptEditorWordWrapCheckbox.Checked = true; - this.scriptEditorWordWrapCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; - this.scriptEditorWordWrapCheckbox.Location = new System.Drawing.Point(904, 10); - this.scriptEditorWordWrapCheckbox.Name = "scriptEditorWordWrapCheckbox"; - this.scriptEditorWordWrapCheckbox.Size = new System.Drawing.Size(72, 23); - this.scriptEditorWordWrapCheckbox.TabIndex = 43; - this.scriptEditorWordWrapCheckbox.Text = "Word Wrap"; - this.scriptEditorWordWrapCheckbox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.scriptEditorWordWrapCheckbox.UseVisualStyleBackColor = true; - this.scriptEditorWordWrapCheckbox.CheckedChanged += new System.EventHandler(this.scriptEditorWordWrapCheckbox_CheckedChanged); - // // groupBox24 // this.groupBox24.Controls.Add(this.SyncNavigatorCB); diff --git a/DS_Map/Main Window.cs b/DS_Map/Main Window.cs index 8d497ee..bfdeeab 100644 --- a/DS_Map/Main Window.cs +++ b/DS_Map/Main Window.cs @@ -307,7 +307,7 @@ namespace DSPRE { itemComboboxIsUpToDate = true; } private void scriptCommandsDatabaseToolStripButton_Click(object sender, EventArgs e) { - OpenCommandsDatabase(RomInfo.ScriptCommandNamesDict, RomInfo.ScriptCommandParametersDict); + OpenCommandsDatabase(RomInfo.ScriptCommandNamesDict, RomInfo.ScriptCommandParametersDict, RomInfo.ScriptActionNamesDict, RomInfo.ScriptComparisonOperatorsDict); } private void nsbmdExportTexButton_Click(object sender, EventArgs e) { OpenFileDialog of = new OpenFileDialog { @@ -417,10 +417,11 @@ namespace DSPRE { DSUtils.WriteToFile(sf.FileName, DSUtils.BuildNSBMDwithTextures(modelFile, textureFile), fromScratch: true); MessageBox.Show("Textures correctly written to NSBMD file.", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } - private void OpenCommandsDatabase(Dictionary namesDict, Dictionary paramsDict) { + private void OpenCommandsDatabase(Dictionary namesDict, Dictionary paramsDict, Dictionary actionsDict, + Dictionary comparisonOPsDict) { statusLabel.Text = "Setting up Commands Database. Please wait..."; Update(); - CommandsDatabase form = new CommandsDatabase(namesDict, paramsDict); + CommandsDatabase form = new CommandsDatabase(namesDict, paramsDict, actionsDict, comparisonOPsDict); form.Show(); statusLabel.Text = "Ready"; } @@ -741,13 +742,16 @@ namespace DSPRE { } } private void diamondAndPearlToolStripMenuItem_Click(object sender, EventArgs e) { - OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.DP), RomInfo.BuildCommandParametersDatabase(gFamEnum.DP)); + OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.DP), RomInfo.BuildCommandParametersDatabase(gFamEnum.DP), + RomInfo.BuildActionNamesDatabase(gFamEnum.DP), RomInfo.BuildComparisonOperatorsDatabase(gFamEnum.DP)); } private void platinumToolStripMenuItem_Click(object sender, EventArgs e) { - OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.Plat), RomInfo.BuildCommandParametersDatabase(gFamEnum.Plat)); + OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.Plat), RomInfo.BuildCommandParametersDatabase(gFamEnum.Plat), + RomInfo.BuildActionNamesDatabase(gFamEnum.Plat), RomInfo.BuildComparisonOperatorsDatabase(gFamEnum.Plat)); } private void heartGoldAndSoulSilverToolStripMenuItem_Click(object sender, EventArgs e) { - OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.HGSS), RomInfo.BuildCommandParametersDatabase(gFamEnum.HGSS)); + OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.HGSS), RomInfo.BuildCommandParametersDatabase(gFamEnum.HGSS), + RomInfo.BuildActionNamesDatabase(gFamEnum.HGSS), RomInfo.BuildComparisonOperatorsDatabase(gFamEnum.HGSS)); } private void mainTabControl_SelectedIndexChanged(object sender, EventArgs e) { if (mainTabControl.SelectedTab == headerEditorTabPage) { @@ -5143,6 +5147,7 @@ namespace DSPRE { } if (isItemRadioButton.Enabled) { owItemComboBox.Enabled = true; + itemsSelectorHelpBtn.Enabled = true; owItemLabel.Enabled = true; currentEvFile.overworlds[overworldsListBox.SelectedIndex].type = 0x3; @@ -5160,6 +5165,7 @@ namespace DSPRE { owPartnerTrainerCheckBox.Enabled = true; owItemComboBox.Enabled = false; + itemsSelectorHelpBtn.Enabled = false; if (disableHandlers) { return; diff --git a/DS_Map/Main Window.resx b/DS_Map/Main Window.resx index ce31cba..6ab95ec 100644 --- a/DS_Map/Main Window.resx +++ b/DS_Map/Main Window.resx @@ -1958,7 +1958,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM - EgAAAk1TRnQBSQFMAgEBCgEAASwBFwEsARcBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + EgAAAk1TRnQBSQFMAgEBCgEAATQBFwE0ARcBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -2136,40 +2136,40 @@ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALzSURBVFhH7ZfLbxJBHMf5ixqj9/Zi9NKzh2oiFiWVA4mn - FoJupEVNNFaNodAeTHwfBCK1oqUP7MGDBqRx8dnE8GogmtZoDfLYWec37LSzyzBLsTVp4i/5BJadne9n - f7s7gGWvV5/2uvuVezTcm5x0I22TloppNN9aLHLU0yhGPTVtc2eqNHNuITXlRr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1aAVeZ7rNmdba7KBnbrhR+fzAvUpv + /YtlsfwGUi4ps6S+aNsAAAAASUVORK5CYII= diff --git a/DS_Map/ROMFiles/ScriptFile.cs b/DS_Map/ROMFiles/ScriptFile.cs index 97e35e8..bd6a745 100644 --- a/DS_Map/ROMFiles/ScriptFile.cs +++ b/DS_Map/ROMFiles/ScriptFile.cs @@ -503,7 +503,7 @@ namespace DSPRE.ROMFiles { int i = 0; while (i < lineSourceL.Count) { int positionOfActionNumber; - if (!lineSourceL[i].Contains(':') || (positionOfActionNumber = lineSourceL[i].IndexOfNumber()) < 0) { // Move on until script header is found + if (!lineSourceL[i].Contains(':') || (positionOfActionNumber = lineSourceL[i].IndexOfNumber()) < 0) { // Move on until action header is found i++; continue; } diff --git a/DS_Map/Resources/CommandsDatabase.Designer.cs b/DS_Map/Resources/CommandsDatabase.Designer.cs index f8a7dd5..1497b11 100644 --- a/DS_Map/Resources/CommandsDatabase.Designer.cs +++ b/DS_Map/Resources/CommandsDatabase.Designer.cs @@ -24,21 +24,39 @@ namespace DSPRE.Resources { /// the contents of this method with the code editor. /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.scriptcmdDataGridView = new System.Windows.Forms.DataGridView(); this.CommandID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.CommandName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ParamsCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Params = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.cmdSearchTextBox = new System.Windows.Forms.TextBox(); - this.startSearchButton = new System.Windows.Forms.Button(); + this.scriptcmdSearchTextBox = new System.Windows.Forms.TextBox(); + this.startSearchButtonScripts = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); - this.criteriaGroupBox = new System.Windows.Forms.GroupBox(); - this.matchCB = new System.Windows.Forms.RadioButton(); - this.containsCB = new System.Windows.Forms.RadioButton(); - this.startsWithCB = new System.Windows.Forms.RadioButton(); + this.criteriaGroupBoxScripts = new System.Windows.Forms.GroupBox(); + this.matchCBScripts = new System.Windows.Forms.RadioButton(); + this.containsCBScripts = new System.Windows.Forms.RadioButton(); + this.startsWithCBScripts = new System.Windows.Forms.RadioButton(); + this.criteriaGroupBoxActions = new System.Windows.Forms.GroupBox(); + this.matchCBActions = new System.Windows.Forms.RadioButton(); + this.containsCBActions = new System.Windows.Forms.RadioButton(); + this.startsWithCBActions = new System.Windows.Forms.RadioButton(); + this.label2 = new System.Windows.Forms.Label(); + this.startSearchButtonActions = new System.Windows.Forms.Button(); + this.actioncmdSearchTextBox = new System.Windows.Forms.TextBox(); + this.actionDataGridView = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.compOPDataGridView = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.scriptcmdDataGridView)).BeginInit(); - this.criteriaGroupBox.SuspendLayout(); + this.criteriaGroupBoxScripts.SuspendLayout(); + this.criteriaGroupBoxActions.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.actionDataGridView)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.compOPDataGridView)).BeginInit(); this.SuspendLayout(); // // scriptcmdDataGridView @@ -51,40 +69,38 @@ namespace DSPRE.Resources { this.CommandName, this.ParamsCount, this.Params}); - this.scriptcmdDataGridView.Location = new System.Drawing.Point(17, 60); + this.scriptcmdDataGridView.Location = new System.Drawing.Point(14, 63); this.scriptcmdDataGridView.Name = "scriptcmdDataGridView"; this.scriptcmdDataGridView.ReadOnly = true; this.scriptcmdDataGridView.RowHeadersVisible = false; - this.scriptcmdDataGridView.Size = new System.Drawing.Size(501, 602); + this.scriptcmdDataGridView.Size = new System.Drawing.Size(506, 622); this.scriptcmdDataGridView.TabIndex = 0; // // CommandID // - this.CommandID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; - dataGridViewCellStyle3.Format = "X4"; - this.CommandID.DefaultCellStyle = dataGridViewCellStyle3; - this.CommandID.FillWeight = 30F; + this.CommandID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle4.Format = "X4"; + this.CommandID.DefaultCellStyle = dataGridViewCellStyle4; + this.CommandID.FillWeight = 15F; this.CommandID.HeaderText = "Command ID"; this.CommandID.MaxInputLength = 10; this.CommandID.Name = "CommandID"; this.CommandID.ReadOnly = true; - this.CommandID.Width = 70; // // CommandName // - this.CommandName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.CommandName.FillWeight = 60F; - this.CommandName.HeaderText = "Command Name"; + this.CommandName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.CommandName.FillWeight = 35F; + this.CommandName.HeaderText = "Script Command Name"; this.CommandName.MaxInputLength = 200; this.CommandName.MinimumWidth = 90; this.CommandName.Name = "CommandName"; this.CommandName.ReadOnly = true; - this.CommandName.Width = 101; // // ParamsCount // this.ParamsCount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ParamsCount.FillWeight = 90F; + this.ParamsCount.FillWeight = 20F; this.ParamsCount.HeaderText = "Parameter Count"; this.ParamsCount.MaxInputLength = 10; this.ParamsCount.MinimumWidth = 20; @@ -94,100 +110,257 @@ namespace DSPRE.Resources { // Params // this.Params.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.Params.FillWeight = 190F; + this.Params.FillWeight = 30F; this.Params.HeaderText = "Parameters"; this.Params.MaxInputLength = 200; this.Params.MinimumWidth = 85; this.Params.Name = "Params"; this.Params.ReadOnly = true; // - // cmdSearchTextBox + // scriptcmdSearchTextBox // - this.cmdSearchTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cmdSearchTextBox.Location = new System.Drawing.Point(9, 26); - this.cmdSearchTextBox.Name = "cmdSearchTextBox"; - this.cmdSearchTextBox.Size = new System.Drawing.Size(145, 22); - this.cmdSearchTextBox.TabIndex = 1; - this.cmdSearchTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cmdSearchTextBox_KeyDown); + this.scriptcmdSearchTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.scriptcmdSearchTextBox.Location = new System.Drawing.Point(14, 26); + this.scriptcmdSearchTextBox.Name = "scriptcmdSearchTextBox"; + this.scriptcmdSearchTextBox.Size = new System.Drawing.Size(141, 22); + this.scriptcmdSearchTextBox.TabIndex = 1; + this.scriptcmdSearchTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.scriptcmdSearchTextBox_KeyDown); // - // startSearchButton + // startSearchButtonScripts // - this.startSearchButton.Image = global::DSPRE.Properties.Resources.wideLensImage; - this.startSearchButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.startSearchButton.Location = new System.Drawing.Point(445, 11); - this.startSearchButton.Name = "startSearchButton"; - this.startSearchButton.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.startSearchButton.Size = new System.Drawing.Size(82, 39); - this.startSearchButton.TabIndex = 17; - this.startSearchButton.Text = "Start\r\nSearch"; - this.startSearchButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.startSearchButton.UseVisualStyleBackColor = true; - this.startSearchButton.Click += new System.EventHandler(this.startSearchButton_Click); + this.startSearchButtonScripts.Image = global::DSPRE.Properties.Resources.wideLensImage; + this.startSearchButtonScripts.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.startSearchButtonScripts.Location = new System.Drawing.Point(433, 15); + this.startSearchButtonScripts.Name = "startSearchButtonScripts"; + this.startSearchButtonScripts.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.startSearchButtonScripts.Size = new System.Drawing.Size(87, 43); + this.startSearchButtonScripts.TabIndex = 17; + this.startSearchButtonScripts.Text = "Start\r\nSearch"; + this.startSearchButtonScripts.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.startSearchButtonScripts.UseVisualStyleBackColor = true; + this.startSearchButtonScripts.Click += new System.EventHandler(this.startSearchButtonScripts_Click); // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(7, 10); + this.label1.Location = new System.Drawing.Point(12, 10); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(148, 13); + this.label1.Size = new System.Drawing.Size(112, 13); this.label1.TabIndex = 18; - this.label1.Text = "Search command name or ID:"; + this.label1.Text = "Command name or ID:"; // - // criteriaGroupBox + // criteriaGroupBoxScripts // - this.criteriaGroupBox.Controls.Add(this.matchCB); - this.criteriaGroupBox.Controls.Add(this.containsCB); - this.criteriaGroupBox.Controls.Add(this.startsWithCB); - this.criteriaGroupBox.Location = new System.Drawing.Point(164, 5); - this.criteriaGroupBox.Name = "criteriaGroupBox"; - this.criteriaGroupBox.Size = new System.Drawing.Size(271, 45); - this.criteriaGroupBox.TabIndex = 19; - this.criteriaGroupBox.TabStop = false; - this.criteriaGroupBox.Text = "Criteria"; + this.criteriaGroupBoxScripts.Controls.Add(this.matchCBScripts); + this.criteriaGroupBoxScripts.Controls.Add(this.containsCBScripts); + this.criteriaGroupBoxScripts.Controls.Add(this.startsWithCBScripts); + this.criteriaGroupBoxScripts.Location = new System.Drawing.Point(161, 10); + this.criteriaGroupBoxScripts.Name = "criteriaGroupBoxScripts"; + this.criteriaGroupBoxScripts.Size = new System.Drawing.Size(266, 46); + this.criteriaGroupBoxScripts.TabIndex = 19; + this.criteriaGroupBoxScripts.TabStop = false; + this.criteriaGroupBoxScripts.Text = "Search Criteria"; // - // matchCB + // matchCBScripts // - this.matchCB.Appearance = System.Windows.Forms.Appearance.Button; - this.matchCB.AutoSize = true; - this.matchCB.Location = new System.Drawing.Point(147, 15); - this.matchCB.Name = "matchCB"; - this.matchCB.Size = new System.Drawing.Size(113, 23); - this.matchCB.TabIndex = 2; - this.matchCB.Text = "Match (Ignore Case)"; - this.matchCB.UseVisualStyleBackColor = true; + this.matchCBScripts.Appearance = System.Windows.Forms.Appearance.Button; + this.matchCBScripts.AutoSize = true; + this.matchCBScripts.Location = new System.Drawing.Point(144, 15); + this.matchCBScripts.Name = "matchCBScripts"; + this.matchCBScripts.Size = new System.Drawing.Size(113, 23); + this.matchCBScripts.TabIndex = 2; + this.matchCBScripts.Text = "Match (Ignore Case)"; + this.matchCBScripts.UseVisualStyleBackColor = true; // - // containsCB + // containsCBScripts // - this.containsCB.Appearance = System.Windows.Forms.Appearance.Button; - this.containsCB.AutoSize = true; - this.containsCB.Checked = true; - this.containsCB.Location = new System.Drawing.Point(8, 15); - this.containsCB.Name = "containsCB"; - this.containsCB.Size = new System.Drawing.Size(58, 23); - this.containsCB.TabIndex = 1; - this.containsCB.TabStop = true; - this.containsCB.Text = "Contains"; - this.containsCB.UseVisualStyleBackColor = true; + this.containsCBScripts.Appearance = System.Windows.Forms.Appearance.Button; + this.containsCBScripts.AutoSize = true; + this.containsCBScripts.Checked = true; + this.containsCBScripts.Location = new System.Drawing.Point(8, 15); + this.containsCBScripts.Name = "containsCBScripts"; + this.containsCBScripts.Size = new System.Drawing.Size(58, 23); + this.containsCBScripts.TabIndex = 1; + this.containsCBScripts.TabStop = true; + this.containsCBScripts.Text = "Contains"; + this.containsCBScripts.UseVisualStyleBackColor = true; // - // startsWithCB + // startsWithCBScripts // - this.startsWithCB.Appearance = System.Windows.Forms.Appearance.Button; - this.startsWithCB.AutoSize = true; - this.startsWithCB.Location = new System.Drawing.Point(74, 15); - this.startsWithCB.Name = "startsWithCB"; - this.startsWithCB.Size = new System.Drawing.Size(66, 23); - this.startsWithCB.TabIndex = 0; - this.startsWithCB.Text = "Starts with"; - this.startsWithCB.UseVisualStyleBackColor = true; + this.startsWithCBScripts.Appearance = System.Windows.Forms.Appearance.Button; + this.startsWithCBScripts.AutoSize = true; + this.startsWithCBScripts.Location = new System.Drawing.Point(72, 15); + this.startsWithCBScripts.Name = "startsWithCBScripts"; + this.startsWithCBScripts.Size = new System.Drawing.Size(66, 23); + this.startsWithCBScripts.TabIndex = 0; + this.startsWithCBScripts.Text = "Starts with"; + this.startsWithCBScripts.UseVisualStyleBackColor = true; + // + // criteriaGroupBoxActions + // + this.criteriaGroupBoxActions.Controls.Add(this.matchCBActions); + this.criteriaGroupBoxActions.Controls.Add(this.containsCBActions); + this.criteriaGroupBoxActions.Controls.Add(this.startsWithCBActions); + this.criteriaGroupBoxActions.Location = new System.Drawing.Point(703, 9); + this.criteriaGroupBoxActions.Name = "criteriaGroupBoxActions"; + this.criteriaGroupBoxActions.Size = new System.Drawing.Size(266, 46); + this.criteriaGroupBoxActions.TabIndex = 24; + this.criteriaGroupBoxActions.TabStop = false; + this.criteriaGroupBoxActions.Text = "Search Criteria"; + // + // matchCBActions + // + this.matchCBActions.Appearance = System.Windows.Forms.Appearance.Button; + this.matchCBActions.AutoSize = true; + this.matchCBActions.Location = new System.Drawing.Point(144, 15); + this.matchCBActions.Name = "matchCBActions"; + this.matchCBActions.Size = new System.Drawing.Size(113, 23); + this.matchCBActions.TabIndex = 2; + this.matchCBActions.Text = "Match (Ignore Case)"; + this.matchCBActions.UseVisualStyleBackColor = true; + // + // containsCBActions + // + this.containsCBActions.Appearance = System.Windows.Forms.Appearance.Button; + this.containsCBActions.AutoSize = true; + this.containsCBActions.Checked = true; + this.containsCBActions.Location = new System.Drawing.Point(8, 15); + this.containsCBActions.Name = "containsCBActions"; + this.containsCBActions.Size = new System.Drawing.Size(58, 23); + this.containsCBActions.TabIndex = 1; + this.containsCBActions.TabStop = true; + this.containsCBActions.Text = "Contains"; + this.containsCBActions.UseVisualStyleBackColor = true; + // + // startsWithCBActions + // + this.startsWithCBActions.Appearance = System.Windows.Forms.Appearance.Button; + this.startsWithCBActions.AutoSize = true; + this.startsWithCBActions.Location = new System.Drawing.Point(72, 15); + this.startsWithCBActions.Name = "startsWithCBActions"; + this.startsWithCBActions.Size = new System.Drawing.Size(66, 23); + this.startsWithCBActions.TabIndex = 0; + this.startsWithCBActions.Text = "Starts with"; + this.startsWithCBActions.UseVisualStyleBackColor = true; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(554, 9); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(95, 13); + this.label2.TabIndex = 23; + this.label2.Text = "Action name or ID:"; + // + // startSearchButtonActions + // + this.startSearchButtonActions.Image = global::DSPRE.Properties.Resources.wideLensImage; + this.startSearchButtonActions.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.startSearchButtonActions.Location = new System.Drawing.Point(975, 14); + this.startSearchButtonActions.Name = "startSearchButtonActions"; + this.startSearchButtonActions.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.startSearchButtonActions.Size = new System.Drawing.Size(87, 43); + this.startSearchButtonActions.TabIndex = 22; + this.startSearchButtonActions.Text = "Start\r\nSearch"; + this.startSearchButtonActions.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.startSearchButtonActions.UseVisualStyleBackColor = true; + this.startSearchButtonActions.Click += new System.EventHandler(this.startSearchButtonActions_Click); + // + // actioncmdSearchTextBox + // + this.actioncmdSearchTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.actioncmdSearchTextBox.Location = new System.Drawing.Point(556, 25); + this.actioncmdSearchTextBox.Name = "actioncmdSearchTextBox"; + this.actioncmdSearchTextBox.Size = new System.Drawing.Size(141, 22); + this.actioncmdSearchTextBox.TabIndex = 21; + this.actioncmdSearchTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.actioncmdSearchTextBox_KeyDown); + // + // actionDataGridView + // + this.actionDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; + this.actionDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders; + this.actionDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.actionDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewTextBoxColumn1, + this.dataGridViewTextBoxColumn2}); + this.actionDataGridView.Location = new System.Drawing.Point(556, 62); + this.actionDataGridView.Name = "actionDataGridView"; + this.actionDataGridView.ReadOnly = true; + this.actionDataGridView.RowHeadersVisible = false; + this.actionDataGridView.Size = new System.Drawing.Size(245, 622); + this.actionDataGridView.TabIndex = 20; + // + // dataGridViewTextBoxColumn1 + // + this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle5.Format = "X4"; + this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle5; + this.dataGridViewTextBoxColumn1.FillWeight = 30F; + this.dataGridViewTextBoxColumn1.HeaderText = "Command ID"; + this.dataGridViewTextBoxColumn1.MaxInputLength = 10; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + this.dataGridViewTextBoxColumn1.ReadOnly = true; + // + // dataGridViewTextBoxColumn2 + // + this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dataGridViewTextBoxColumn2.FillWeight = 60F; + this.dataGridViewTextBoxColumn2.HeaderText = "Action Command Name"; + this.dataGridViewTextBoxColumn2.MaxInputLength = 200; + this.dataGridViewTextBoxColumn2.MinimumWidth = 90; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + this.dataGridViewTextBoxColumn2.ReadOnly = true; + // + // compOPDataGridView + // + this.compOPDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; + this.compOPDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders; + this.compOPDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.compOPDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewTextBoxColumn3, + this.dataGridViewTextBoxColumn4}); + this.compOPDataGridView.Location = new System.Drawing.Point(817, 62); + this.compOPDataGridView.Name = "compOPDataGridView"; + this.compOPDataGridView.ReadOnly = true; + this.compOPDataGridView.RowHeadersVisible = false; + this.compOPDataGridView.Size = new System.Drawing.Size(245, 622); + this.compOPDataGridView.TabIndex = 25; + // + // dataGridViewTextBoxColumn3 + // + this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle6.Format = "X4"; + this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle6; + this.dataGridViewTextBoxColumn3.FillWeight = 30F; + this.dataGridViewTextBoxColumn3.HeaderText = "Operator ID"; + this.dataGridViewTextBoxColumn3.MaxInputLength = 10; + this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; + this.dataGridViewTextBoxColumn3.ReadOnly = true; + // + // dataGridViewTextBoxColumn4 + // + this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dataGridViewTextBoxColumn4.FillWeight = 60F; + this.dataGridViewTextBoxColumn4.HeaderText = "Comparison Operator Name"; + this.dataGridViewTextBoxColumn4.MaxInputLength = 200; + this.dataGridViewTextBoxColumn4.MinimumWidth = 90; + this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; + this.dataGridViewTextBoxColumn4.ReadOnly = true; // // CommandsDatabase // this.AutoSize = true; - this.ClientSize = new System.Drawing.Size(536, 676); - this.Controls.Add(this.criteriaGroupBox); + this.ClientSize = new System.Drawing.Size(1075, 697); + this.Controls.Add(this.compOPDataGridView); + this.Controls.Add(this.criteriaGroupBoxActions); + this.Controls.Add(this.label2); + this.Controls.Add(this.startSearchButtonActions); + this.Controls.Add(this.actioncmdSearchTextBox); + this.Controls.Add(this.actionDataGridView); + this.Controls.Add(this.criteriaGroupBoxScripts); this.Controls.Add(this.label1); - this.Controls.Add(this.startSearchButton); - this.Controls.Add(this.cmdSearchTextBox); + this.Controls.Add(this.startSearchButtonScripts); + this.Controls.Add(this.scriptcmdSearchTextBox); this.Controls.Add(this.scriptcmdDataGridView); this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; @@ -196,8 +369,12 @@ namespace DSPRE.Resources { this.Name = "CommandsDatabase"; this.Text = "Script Commands Database"; ((System.ComponentModel.ISupportInitialize)(this.scriptcmdDataGridView)).EndInit(); - this.criteriaGroupBox.ResumeLayout(false); - this.criteriaGroupBox.PerformLayout(); + this.criteriaGroupBoxScripts.ResumeLayout(false); + this.criteriaGroupBoxScripts.PerformLayout(); + this.criteriaGroupBoxActions.ResumeLayout(false); + this.criteriaGroupBoxActions.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.actionDataGridView)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.compOPDataGridView)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -206,16 +383,29 @@ namespace DSPRE.Resources { #endregion private System.Windows.Forms.DataGridView scriptcmdDataGridView; - private System.Windows.Forms.TextBox cmdSearchTextBox; - private System.Windows.Forms.Button startSearchButton; + private System.Windows.Forms.TextBox scriptcmdSearchTextBox; + private System.Windows.Forms.Button startSearchButtonScripts; private System.Windows.Forms.Label label1; - private System.Windows.Forms.GroupBox criteriaGroupBox; - private System.Windows.Forms.RadioButton matchCB; - private System.Windows.Forms.RadioButton containsCB; - private System.Windows.Forms.RadioButton startsWithCB; + private System.Windows.Forms.GroupBox criteriaGroupBoxScripts; + private System.Windows.Forms.RadioButton matchCBScripts; + private System.Windows.Forms.RadioButton containsCBScripts; + private System.Windows.Forms.RadioButton startsWithCBScripts; + private System.Windows.Forms.GroupBox criteriaGroupBoxActions; + private System.Windows.Forms.RadioButton matchCBActions; + private System.Windows.Forms.RadioButton containsCBActions; + private System.Windows.Forms.RadioButton startsWithCBActions; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button startSearchButtonActions; + private System.Windows.Forms.TextBox actioncmdSearchTextBox; + private System.Windows.Forms.DataGridView actionDataGridView; + private System.Windows.Forms.DataGridView compOPDataGridView; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; private System.Windows.Forms.DataGridViewTextBoxColumn CommandID; private System.Windows.Forms.DataGridViewTextBoxColumn CommandName; private System.Windows.Forms.DataGridViewTextBoxColumn ParamsCount; private System.Windows.Forms.DataGridViewTextBoxColumn Params; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; } } \ No newline at end of file diff --git a/DS_Map/Resources/CommandsDatabase.cs b/DS_Map/Resources/CommandsDatabase.cs index 08f3279..68042dd 100644 --- a/DS_Map/Resources/CommandsDatabase.cs +++ b/DS_Map/Resources/CommandsDatabase.cs @@ -8,87 +8,129 @@ namespace DSPRE.Resources { private DataGridViewRow currentrow; private Dictionary namesDict; private Dictionary paramsDict; + private Dictionary actionsDict; + private Dictionary comparisonOPsDict; - public CommandsDatabase(Dictionary namesDict, Dictionary paramsDict) { + private List scriptRadioButtons; + private List actionRadioButtons; + + public CommandsDatabase(Dictionary namesDict, Dictionary paramsDict, Dictionary actionsDict, + Dictionary comparisonOPsDict) { this.namesDict = namesDict; this.paramsDict = paramsDict; + this.actionsDict = actionsDict; + this.comparisonOPsDict = comparisonOPsDict; + InitializeComponent(); - SetupFromScriptDictionaries(); + SetupFromScriptDictionaries(scriptcmdDataGridView, paramsDict.Keys.Max(), namesDict, paramsDict); + SetupFromScriptDictionaries(actionDataGridView, actionsDict.Keys.Max(), actionsDict); + SetupFromScriptDictionaries(compOPDataGridView, comparisonOPsDict.Keys.Max(), comparisonOPsDict); + + scriptRadioButtons = new List() { + containsCBScripts, + startsWithCBScripts, + matchCBScripts + }; + actionRadioButtons = new List() { + containsCBActions, + startsWithCBActions, + matchCBActions + }; } - private void SetupFromScriptDictionaries() { - for (int i = 0; i < paramsDict.Count - 1; i++) - scriptcmdDataGridView.Rows.Add(); + private void SetupFromScriptDictionaries(DataGridView table, int entriesCount, Dictionary sourceNamesDict, Dictionary sourceParamsDict = null) { + table.Rows.Clear(); + for (int i = 0; i < entriesCount; i++) { + table.Rows.Add(); + } - var paramDictKeys = paramsDict.Keys; - var paramDictValues = paramsDict.Values; - var namesDictValues = namesDict.Values; + DataGridViewRowCollection list = table.Rows; + for (ushort i = 0; i < list.Count; i++) { //loop through + DataGridViewRow r = list[i]; + ushort currentID = i; - System.Collections.IList list = scriptcmdDataGridView.Rows; - for (int i = 0; i < list.Count; i++) { //loop through - DataGridViewRow r = (DataGridViewRow)list[i]; + string buffer = ""; + sourceNamesDict.TryGetValue(i, out buffer); + string commandName = buffer; - ushort currentID = paramDictKeys.ElementAt(i); r.Cells[0].Value = currentID.ToString("X4"); + r.Cells[1].Value = commandName; - string commandName; - if (namesDict.TryGetValue(currentID, out commandName)) - r.Cells[1].Value = commandName; - - try { - if (paramDictValues.ElementAt(i)[0] == 0) { - r.Cells[2].Value = 0; - } else { - r.Cells[2].Value = paramDictValues.ElementAt(i).Length;//.ToString(); - } - } catch { } - - string paramSize = ""; - try { - foreach (byte size in paramDictValues.ElementAt(i)) { - if (size != 0) { - paramSize += size + "B; "; + if (sourceParamsDict != null) { + var paramDictValues = sourceParamsDict.Values; + try { + if (paramDictValues.ElementAt(i)[0] == 0) { + r.Cells[2].Value = 0; + } else { + r.Cells[2].Value = paramDictValues.ElementAt(i).Length;//.ToString(); } - } - } catch { } + } catch { } - scriptcmdDataGridView.Rows[i].Cells[3].Value = paramSize; + string paramSize = ""; + try { + foreach (byte size in paramDictValues.ElementAt(i)) { + if (size != 0) { + paramSize += size + "B; "; + } + } + } catch { } + + table.Rows[i].Cells[3].Value = paramSize; + } } } - private void startSearchButton_Click(object sender, EventArgs e) { + private void startSearchButtonScripts_Click(object sender, EventArgs e) { + StartSearch(scriptcmdDataGridView, scriptcmdSearchTextBox, scriptRadioButtons); + } + private void startSearchButtonActions_Click(object sender, EventArgs e) { + StartSearch(actionDataGridView, actioncmdSearchTextBox, actionRadioButtons); + } + private void StartSearch(DataGridView table, TextBox searchBox, List rbl) { try { - if (containsCB.Checked) { - scanAllRows(() => currentrow.Cells[1].Value.ToString().IndexOf(cmdSearchTextBox.Text, StringComparison.InvariantCultureIgnoreCase) >= 0); - } else if (startsWithCB.Checked) { - scanAllRows(() => currentrow.Cells[1].Value.ToString().StartsWith(cmdSearchTextBox.Text, StringComparison.InvariantCultureIgnoreCase)); - } else { - scanAllRows(() => currentrow.Cells[1].Value.ToString().Equals(cmdSearchTextBox.Text, StringComparison.InvariantCultureIgnoreCase)); + if (rbl[0].Checked) { //Contains + scanAllRows(table, + (x) => x.Value.ToString().IndexOf(searchBox.Text, StringComparison.InvariantCultureIgnoreCase) >= 0); + } else if (rbl[1].Checked) { //StartsWith + scanAllRows(table, + (x) => x.Value.ToString().StartsWith(searchBox.Text, StringComparison.InvariantCultureIgnoreCase)); + } else if (rbl[2].Checked) { //Exact Match + scanAllRows(table, + (x) => x.Value.ToString().Equals(searchBox.Text, StringComparison.InvariantCultureIgnoreCase)); } } catch (OperationCanceledException) { - scriptcmdDataGridView.ClearSelection(); - scriptcmdDataGridView.FirstDisplayedScrollingRowIndex = currentrow.Index; + table.ClearSelection(); + table.FirstDisplayedScrollingRowIndex = currentrow.Index; currentrow.Selected = true; return; } } - private void scanAllRows(Func expression) { - for (int i = 0; i < scriptcmdDataGridView.Rows.Count; i++) { - currentrow = scriptcmdDataGridView.Rows[i]; + private void scanAllRows(DataGridView table, Func function) { + for (int i = 0; i < table.Rows.Count; i++) { + currentrow = table.Rows[i]; + if (currentrow.Cells[1].Value == null) { + continue; + } try { - if (expression()) { //Cancel research when found + if (function(currentrow.Cells[1])) { //Cancel research when found throw new OperationCanceledException(); } } catch (NullReferenceException) { } } } - private void cmdSearchTextBox_KeyDown(object sender, KeyEventArgs e) { + private void scriptcmdSearchTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { - startSearchButton_Click(null, null); + StartSearch(scriptcmdDataGridView, scriptcmdSearchTextBox, scriptRadioButtons); + } + } + + private void actioncmdSearchTextBox_KeyDown(object sender, KeyEventArgs e) { + if (e.KeyCode == Keys.Enter) { + StartSearch(actionDataGridView, actioncmdSearchTextBox, actionRadioButtons); } } } diff --git a/DS_Map/Resources/CommandsDatabase.resx b/DS_Map/Resources/CommandsDatabase.resx index d941c23..d993041 100644 --- a/DS_Map/Resources/CommandsDatabase.resx +++ b/DS_Map/Resources/CommandsDatabase.resx @@ -141,6 +141,30 @@ True + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + 35 diff --git a/DS_Map/Resources/ScriptDatabase.cs b/DS_Map/Resources/ScriptDatabase.cs index 2f5e1f3..7bf1d4a 100644 --- a/DS_Map/Resources/ScriptDatabase.cs +++ b/DS_Map/Resources/ScriptDatabase.cs @@ -109,9 +109,14 @@ namespace DSPRE.Resources { [0x0040] = "Freeze15", [0x0041] = "Freeze16", [0x0042] = "Freeze32", - [0x0045] = "WaitDisappear", + [0x0043] = "TeleportUp", + [0x0044] = "TeleportDown", + [0x0045] = "DisappearTrue", + [0x0046] = "DisappearFalse", [0x0047] = "LockDir", [0x0048] = "ReleaseDir", + [0x0049] = "StopAnimation", + [0x004A] = "ResumeAnimation", [0x004B] = "Exclamation", [0x004C] = "WaitWalkUpSlow", [0x004D] = "WaitWalkDownSlow",