From 44212d48aee25ebdddc6dde5cb5fd34e9e5f7d1f Mon Sep 17 00:00:00 2001 From: igorseabra4 Date: Wed, 14 Nov 2018 18:35:25 -0300 Subject: [PATCH] begin implementation of multiselect --- .../ArchiveEditor/ArchiveEditor.Designer.cs | 17 +- IndustrialPark/ArchiveEditor/ArchiveEditor.cs | 161 ++++++++++------ .../ArchiveEditor/ArchiveEditorFunctions.cs | 179 ++++++++++++------ IndustrialPark/MainForm/MainForm.cs | 2 +- 4 files changed, 231 insertions(+), 128 deletions(-) diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs b/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs index cd2f4081..94062e26 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs @@ -98,7 +98,7 @@ private void InitializeComponent() // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(178, 22); this.openToolStripMenuItem.Text = "Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // @@ -106,7 +106,7 @@ private void InitializeComponent() // this.saveToolStripMenuItem.Enabled = false; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(178, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // @@ -114,38 +114,38 @@ private void InitializeComponent() // this.saveAsToolStripMenuItem.Enabled = false; this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(178, 22); this.saveAsToolStripMenuItem.Text = "Save As..."; this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(175, 6); // // exportTexturesToolStripMenuItem // this.exportTexturesToolStripMenuItem.Name = "exportTexturesToolStripMenuItem"; - this.exportTexturesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.exportTexturesToolStripMenuItem.Size = new System.Drawing.Size(178, 22); this.exportTexturesToolStripMenuItem.Text = "Export TXD Archive"; this.exportTexturesToolStripMenuItem.Click += new System.EventHandler(this.exportTexturesToolStripMenuItem_Click); // // importTXDArchiveToolStripMenuItem // this.importTXDArchiveToolStripMenuItem.Name = "importTXDArchiveToolStripMenuItem"; - this.importTXDArchiveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.importTXDArchiveToolStripMenuItem.Size = new System.Drawing.Size(178, 22); this.importTXDArchiveToolStripMenuItem.Text = "Import TXD Archive"; this.importTXDArchiveToolStripMenuItem.Click += new System.EventHandler(this.importTXDArchiveToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(175, 6); // // closeToolStripMenuItem // this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.closeToolStripMenuItem.Size = new System.Drawing.Size(178, 22); this.closeToolStripMenuItem.Text = "Close"; this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); // @@ -247,6 +247,7 @@ private void InitializeComponent() this.listBoxAssets.FormattingEnabled = true; this.listBoxAssets.Location = new System.Drawing.Point(6, 40); this.listBoxAssets.Name = "listBoxAssets"; + this.listBoxAssets.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; this.listBoxAssets.Size = new System.Drawing.Size(507, 290); this.listBoxAssets.TabIndex = 3; this.listBoxAssets.SelectedIndexChanged += new System.EventHandler(this.listBoxAssets_SelectedIndexChanged); diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditor.cs b/IndustrialPark/ArchiveEditor/ArchiveEditor.cs index c60a1d65..e78b3733 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditor.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditor.cs @@ -1,4 +1,5 @@ using HipHopFile; +using Microsoft.WindowsAPICodePack.Dialogs; using Newtonsoft.Json; using SharpDX; using System; @@ -291,7 +292,7 @@ private void buttonAddAsset_Click(object sender, EventArgs e) archive.AddAsset(comboBoxLayers.SelectedIndex, AHDR); comboBoxLayers.Items[comboBoxLayers.SelectedIndex] = LayerToString(comboBoxLayers.SelectedIndex); PopulateAssetListAndComboBox(); - SetSelectedIndex(AHDR.assetID); + SetSelectedIndexes(new List() { AHDR.assetID }); } catch (Exception ex) { @@ -306,33 +307,45 @@ private void buttonDuplicate_Click(object sender, EventArgs e) UnsavedChanges = true; - string serializedObject = JsonConvert.SerializeObject(archive.GetFromAssetID(CurrentlySelectedAssetID()).AHDR); - Section_AHDR AHDR = JsonConvert.DeserializeObject(serializedObject); + List finalIndexes = new List(); + foreach (uint u in archive.GetCurrentlySelectedAssetIDs()) + { + string serializedObject = JsonConvert.SerializeObject(archive.GetFromAssetID(u).AHDR); + Section_AHDR AHDR = JsonConvert.DeserializeObject(serializedObject); + + archive.AddAssetWithUniqueID(comboBoxLayers.SelectedIndex, AHDR); - archive.AddAssetWithUniqueID(comboBoxLayers.SelectedIndex, AHDR); + finalIndexes.Add(AHDR.assetID); + } comboBoxLayers.Items[comboBoxLayers.SelectedIndex] = LayerToString(comboBoxLayers.SelectedIndex); PopulateAssetListAndComboBox(); - SetSelectedIndex(AHDR.assetID); + SetSelectedIndexes(finalIndexes); } private void buttonCopy_Click(object sender, EventArgs e) { if (listBoxAssets.SelectedIndex < 0) return; - Clipboard.SetText(JsonConvert.SerializeObject(archive.GetFromAssetID(CurrentlySelectedAssetID()).AHDR, Formatting.Indented)); + List copiedAHDRs = new List(); + + foreach (uint u in archive.GetCurrentlySelectedAssetIDs()) + copiedAHDRs.Add(archive.GetFromAssetID(u).AHDR); + + Clipboard.SetText(JsonConvert.SerializeObject(copiedAHDRs)); } private void buttonPaste_Click(object sender, EventArgs e) { - Section_AHDR AHDR; + List AHDRs; + List assetIDs = new List(); UnsavedChanges = true; try { - AHDR = JsonConvert.DeserializeObject(Clipboard.GetText()); + AHDRs = JsonConvert.DeserializeObject>(Clipboard.GetText()); } catch (Exception ex) { @@ -340,19 +353,23 @@ private void buttonPaste_Click(object sender, EventArgs e) return; } - archive.AddAssetWithUniqueID(comboBoxLayers.SelectedIndex, AHDR); + foreach (Section_AHDR AHDR in AHDRs) + { + archive.AddAssetWithUniqueID(comboBoxLayers.SelectedIndex, AHDR); + assetIDs.Add(AHDR.assetID); + } comboBoxLayers.Items[comboBoxLayers.SelectedIndex] = LayerToString(comboBoxLayers.SelectedIndex); PopulateAssetListAndComboBox(); - SetSelectedIndex(AHDR.assetID); + SetSelectedIndexes(assetIDs); } private void buttonRemoveAsset_Click(object sender, EventArgs e) { if (listBoxAssets.SelectedIndex < 0) return; - archive.RemoveAsset(CurrentlySelectedAssetID()); + archive.RemoveAsset(CurrentlySelectedAssetIDs()); comboBoxLayers.Items[comboBoxLayers.SelectedIndex] = LayerToString(comboBoxLayers.SelectedIndex); UnsavedChanges = true; @@ -364,9 +381,9 @@ private void buttonView_Click(object sender, EventArgs e) { if (listBoxAssets.SelectedIndex < 0) return; - if (archive.GetFromAssetID(CurrentlySelectedAssetID()) is AssetCAM cam) + if (archive.GetFromAssetID(CurrentlySelectedAssetIDs()[0]) is AssetCAM cam) Program.MainForm.renderer.Camera.SetPositionCamera(cam); - else if (archive.GetFromAssetID(CurrentlySelectedAssetID()) is IClickableAsset a) + else if (archive.GetFromAssetID(CurrentlySelectedAssetIDs()[0]) is IClickableAsset a) Program.MainForm.renderer.Camera.SetPosition(new Vector3(a.PositionX, a.PositionY, a.PositionZ) - 8 * Program.MainForm.renderer.Camera.GetForward()); } @@ -374,7 +391,7 @@ private void buttonEditAsset_Click(object sender, EventArgs e) { try { - uint oldAssetID = CurrentlySelectedAssetID(); + uint oldAssetID = CurrentlySelectedAssetIDs()[0]; Section_AHDR AHDR = AddAssetDialog.GetAsset(archive.GetFromAssetID(oldAssetID).AHDR, out bool success); if (success) @@ -390,7 +407,7 @@ private void buttonEditAsset_Click(object sender, EventArgs e) archive.AddAsset(comboBoxLayers.SelectedIndex, AHDR); PopulateAssetListAndComboBox(); - SetSelectedIndex(AHDR.assetID); + SetSelectedIndexes(new List() { AHDR.assetID }); } } catch (Exception ex) @@ -403,7 +420,7 @@ private void buttonInternalEdit_Click(object sender, EventArgs e) { if (listBoxAssets.SelectedItem != null) { - archive.OpenInternalEditor(); + archive.OpenInternalEditor(archive.GetCurrentlySelectedAssetIDs()); UnsavedChanges = true; } } @@ -413,28 +430,47 @@ private void buttonExportRaw_Click(object sender, EventArgs e) if (listBoxAssets.SelectedItem == null) return; - SaveFileDialog saveFileDialog = new SaveFileDialog() + if (CurrentlySelectedAssetIDs().Count == 1) { - FileName = archive.GetFromAssetID(CurrentlySelectedAssetID()).AHDR.ADBG.assetName - }; - if (saveFileDialog.ShowDialog() == DialogResult.OK) - { - try + SaveFileDialog saveFileDialog = new SaveFileDialog() { - File.WriteAllBytes(saveFileDialog.FileName, archive.GetFromAssetID(CurrentlySelectedAssetID()).AHDR.data); - } - catch (Exception ex) + FileName = archive.GetFromAssetID(CurrentlySelectedAssetIDs()[0]).AHDR.ADBG.assetName + }; + if (saveFileDialog.ShowDialog() == DialogResult.OK) + try + { + File.WriteAllBytes(saveFileDialog.FileName, archive.GetFromAssetID(CurrentlySelectedAssetIDs()[0]).AHDR.data); + } + catch (Exception ex) + { + MessageBox.Show("Unable to export asset raw data: " + ex.Message); + } + } + else + { + CommonOpenFileDialog saveFileDialog = new CommonOpenFileDialog() { - MessageBox.Show("Unable to export asset raw data: " + ex.Message); - } + IsFolderPicker = true + }; + if (saveFileDialog.ShowDialog() == CommonFileDialogResult.Ok) + foreach (uint u in CurrentlySelectedAssetIDs()) + try + { + File.WriteAllBytes(saveFileDialog.FileName + "\\" + archive.GetFromAssetID(u).AHDR.ADBG.assetName, archive.GetFromAssetID(u).AHDR.data); + } + catch (Exception ex) + { + MessageBox.Show("Unable to export asset raw data: " + ex.Message); + } } } - private uint CurrentlySelectedAssetID() + private List CurrentlySelectedAssetIDs() { - if (listBoxAssets.SelectedItem != null) - return GetAssetIDFromName(listBoxAssets.SelectedItem as string); - else return 0; + List list = new List(); + foreach (object i in listBoxAssets.SelectedItems) + list.Add(GetAssetIDFromName(i as string)); + return list; } private uint GetAssetIDFromName(string name) @@ -463,19 +499,30 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) private void listBoxAssets_SelectedIndexChanged(object sender, EventArgs e) { - if (listBoxAssets.SelectedItem != null) + if (listBoxAssets.SelectedItems != null) { - archive.SelectAsset(CurrentlySelectedAssetID()); + archive.ClearSelectedAssets(); + foreach (string s in listBoxAssets.SelectedItems) + archive.SelectAsset(GetAssetIDFromName(s), true); - if (archive.GetFromAssetID(CurrentlySelectedAssetID()) is IClickableAsset a) + if (listBoxAssets.SelectedItems.Count == 1) { - if (a is AssetDYNA dyna) - buttonView.Visible = dyna.IsRenderableClickable; + buttonEditAsset.Enabled = true; + + if (archive.GetFromAssetID(CurrentlySelectedAssetIDs()[0]) is IClickableAsset a) + { + if (a is AssetDYNA dyna) + buttonView.Visible = dyna.IsRenderableClickable; + else + buttonView.Visible = true; + } else - buttonView.Visible = true; + buttonView.Visible = false; } else - buttonView.Visible = false; + { + buttonEditAsset.Enabled = false; + } } } @@ -489,32 +536,26 @@ public void MouseMoveY(SharpCamera camera, int deltaY) archive.MouseMoveY(camera, deltaY); } - public void SetSelectedIndex(uint assetID) + public void SetSelectedIndexes(List assetIDs, bool add = false) { - if (!archive.ContainsAsset(assetID)) - { - archive.SelectAsset(0); - listBoxAssets.SelectedIndex = -1; - return; - } + if (!add) + listBoxAssets.SelectedIndices.Clear(); - try + foreach (uint u in assetIDs) { - comboBoxLayers.SelectedIndex = archive.GetLayerFromAssetID(assetID); - comboBoxAssetTypes.SelectedItem = archive.GetFromAssetID(assetID).AHDR.assetType; - } - catch - { - PopulateAssetList(); - } - - for (int i = 0; i < listBoxAssets.Items.Count; i++) - { - if (GetAssetIDFromName(listBoxAssets.Items[i] as string) == assetID) + try { - listBoxAssets.SelectedIndex = i; - return; + comboBoxLayers.SelectedIndex = archive.GetLayerFromAssetID(u); + comboBoxAssetTypes.SelectedItem = archive.GetFromAssetID(u).AHDR.assetType; } + catch + { + PopulateAssetList(); + } + + for (int i = 0; i < listBoxAssets.Items.Count; i++) + if (GetAssetIDFromName(listBoxAssets.Items[i] as string) == u) + listBoxAssets.SelectedIndices.Add(i); } } @@ -532,7 +573,7 @@ private void textBoxFindAsset_TextChanged(object sender, EventArgs e) { textBoxFindAsset.BackColor = defaultColor; assetID = AssetIDTypeConverter.AssetIDFromString(textBoxFindAsset.Text); - SetSelectedIndex(assetID); + SetSelectedIndexes(new List() { assetID }); } catch { diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs index 25f395c3..f1dfb50c 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs @@ -45,7 +45,7 @@ public void OpenFile(string fileName) { Dispose(); - currentlySelectedAssetID = 0; + currentlySelectedAssets = new List(); currentlyOpenFilePath = fileName; fileNamePrefix = Path.GetFileNameWithoutExtension(fileName); @@ -483,9 +483,16 @@ public void AddAssetWithUniqueID(int layerIndex, Section_AHDR AHDR) AddAsset(layerIndex, AHDR); } + public void RemoveAsset(IEnumerable assetIDs) + { + foreach (uint u in assetIDs) + RemoveAsset(u); + } + public void RemoveAsset(uint assetID) { - CloseInternalEditor(currentlySelectedAssetID); + UnselectAsset(assetID); + CloseInternalEditor(assetID); for (int i = 0; i < DICT.LTOC.LHDRList.Count; i++) if (DICT.LTOC.LHDRList[i].assetIDlist.Contains(assetID)) @@ -516,43 +523,74 @@ public void RemoveAsset(uint assetID) RemoveSoundFromSNDI(assetID); assetDictionary.Remove(assetID); + } + + private List currentlySelectedAssets = new List(); + + public bool AssetIsSelected(uint assetID) + { + for (int i = 0; i < currentlySelectedAssets.Count; i++) + if (currentlySelectedAssets[i].AHDR.assetID == assetID) + return true; - if (assetID == currentlySelectedAssetID) - currentlySelectedAssetID = 0; + return false; } - private uint currentlySelectedAssetID = 0; + public void UnselectAsset(uint assetID) + { + for (int i = 0; i < currentlySelectedAssets.Count; i++) + { + if (currentlySelectedAssets[i].AHDR.assetID == assetID) + { + currentlySelectedAssets[i].isSelected = false; + currentlySelectedAssets.RemoveAt(i); + return; + } + } + } - public uint getCurrentlySelectedAssetID() + public void ClearSelectedAssets() { - return currentlySelectedAssetID; + for (int i = 0; i < currentlySelectedAssets.Count; i++) + currentlySelectedAssets[i].isSelected = false; + + currentlySelectedAssets.Clear(); } - public void SelectAsset(uint assetID) + public List GetCurrentlySelectedAssetIDs() { - if (assetDictionary.ContainsKey(currentlySelectedAssetID)) - assetDictionary[currentlySelectedAssetID].isSelected = false; - currentlySelectedAssetID = assetID; + List selectedAssetIDs = new List(); + foreach (Asset a in currentlySelectedAssets) + selectedAssetIDs.Add(a.AHDR.assetID); - if (currentlySelectedAssetID != 0) - { - assetDictionary[currentlySelectedAssetID].isSelected = true; + return selectedAssetIDs; + } - bool updateGizmos = false; + public void SelectAsset(uint assetID, bool add) + { + if (!add) + ClearSelectedAssets(); - if (assetDictionary[currentlySelectedAssetID] is IClickableAsset ra) - { - if (ra is AssetDYNA dyna) - updateGizmos = dyna.IsRenderableClickable; - else - updateGizmos = true; - } + if (!assetDictionary.ContainsKey(assetID)) + return; - if (updateGizmos) - UpdateGizmoPosition(); + assetDictionary[assetID].isSelected = true; + currentlySelectedAssets.Add(assetDictionary[assetID]); + + bool updateGizmos = false; + + if (assetDictionary[assetID] is IClickableAsset ra) + { + if (ra is AssetDYNA dyna) + updateGizmos = dyna.IsRenderableClickable; else - ClearGizmos(); + updateGizmos = true; } + + if (updateGizmos) + UpdateGizmoPosition(); + else + ClearGizmos(); } public int GetLayerFromAssetID(uint assetID) @@ -578,11 +616,15 @@ public void CloseInternalEditor(uint assetID) internalEditors[i].Close(); } - public void OpenInternalEditor(Asset asset = null) + public void OpenInternalEditor(List list) { - if (asset == null) - asset = GetFromAssetID(currentlySelectedAssetID); + foreach (uint u in list) + if (assetDictionary.ContainsKey(u)) + OpenInternalEditor(assetDictionary[u]); + } + private void OpenInternalEditor(Asset asset) + { for (int i = 0; i < internalEditors.Count; i++) if (internalEditors[i].GetAssetID() == asset.AHDR.assetID) internalEditors[i].Close(); @@ -693,8 +735,29 @@ public static void RenderGizmos(SharpRenderer renderer) public void UpdateGizmoPosition() { - IClickableAsset currentAsset = ((IClickableAsset)assetDictionary[currentlySelectedAssetID]); - UpdateGizmoPosition(currentAsset.GetGizmoCenter()); + if (currentlySelectedAssets.Count == 0) + UpdateGizmoPosition(new BoundingSphere()); + else + { + bool found = false; + BoundingSphere bs = new BoundingSphere(); + + foreach (Asset a in currentlySelectedAssets) + { + if (a is IClickableAsset ica) + { + if (!found) + { + found = true; + bs = ica.GetGizmoCenter(); + } + else + bs = BoundingSphere.Merge(bs, ica.GetGizmoCenter()); + } + } + + UpdateGizmoPosition(bs); + } } private static void UpdateGizmoPosition(BoundingSphere position) @@ -744,41 +807,39 @@ public static void ScreenUnclicked() public void MouseMoveX(SharpCamera camera, int distance) { - if (currentlySelectedAssetID == 0) return; - - if (assetDictionary[currentlySelectedAssetID] is IClickableAsset ra) - { - if (gizmos[0].isSelected) - { - ra.PositionX += ( - (camera.Yaw >= -360 & camera.Yaw < -270) | - (camera.Yaw >= -90 & camera.Yaw < 90) | - (camera.Yaw >= 270)) ? distance / 10f : -distance / 10f; - UpdateGizmoPosition(); - FinishedMovingGizmo = true; - } - else if (gizmos[2].isSelected) + foreach (Asset a in currentlySelectedAssets) + if (a is IClickableAsset ra) { - ra.PositionZ += ( - (camera.Yaw >= -180 & camera.Yaw < 0) | - (camera.Yaw >= 180)) ? distance / 10f : -distance / 10f; - UpdateGizmoPosition(); - FinishedMovingGizmo = true; + if (gizmos[0].isSelected) + { + ra.PositionX += ( + (camera.Yaw >= -360 & camera.Yaw < -270) | + (camera.Yaw >= -90 & camera.Yaw < 90) | + (camera.Yaw >= 270)) ? distance / 10f : -distance / 10f; + UpdateGizmoPosition(); + FinishedMovingGizmo = true; + } + else if (gizmos[2].isSelected) + { + ra.PositionZ += ( + (camera.Yaw >= -180 & camera.Yaw < 0) | + (camera.Yaw >= 180)) ? distance / 10f : -distance / 10f; + UpdateGizmoPosition(); + FinishedMovingGizmo = true; + } } - } } public void MouseMoveY(SharpCamera camera, int distance) { - if (currentlySelectedAssetID == 0) return; - - if (assetDictionary[currentlySelectedAssetID] is IClickableAsset ra) - if (gizmos[1].isSelected) - { - ra.PositionY -= distance / 10f; - UpdateGizmoPosition(); - FinishedMovingGizmo = true; - } + foreach (Asset a in currentlySelectedAssets) + if (a is IClickableAsset ra) + if (gizmos[1].isSelected) + { + ra.PositionY -= distance / 10f; + UpdateGizmoPosition(); + FinishedMovingGizmo = true; + } } public void ExportTextureDictionary(string fileName) diff --git a/IndustrialPark/MainForm/MainForm.cs b/IndustrialPark/MainForm/MainForm.cs index 7bc224dd..822c645a 100644 --- a/IndustrialPark/MainForm/MainForm.cs +++ b/IndustrialPark/MainForm/MainForm.cs @@ -617,7 +617,7 @@ private void renderPanel_MouseLeave(object sender, EventArgs e) public void SetSelectedIndex(uint assetID) { foreach (ArchiveEditor ae in archiveEditors) - ae.SetSelectedIndex(assetID); + ae.SetSelectedIndexes(new List() { assetID }, PressedKeys.Contains(Keys.ControlKey) || PressedKeys.Contains(Keys.Control)); } private void addTextureFolderToolStripMenuItem_Click(object sender, EventArgs e)