diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 887ceae4..66dd61ec 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -1236,26 +1236,30 @@ private void treeViewMain_ItemDrag(object sender, ItemDragEventArgs e) if ((node.TryGetTagData(out PckAsset asset) && currentPCK.Contains(asset.Filename, asset.Type)) || node.Parent is TreeNode) { - treeViewMain.DoDragDrop(node, DragDropEffects.Move); - } - } + // TODO: add (mouse) scrolling while dragging item(s) + treeViewMain.DoDragDrop(node, DragDropEffects.Scroll | DragDropEffects.Move); + } + } - private void treeViewMain_DragOver(object sender, DragEventArgs e) + private void treeViewMain_DragOver(object sender, DragEventArgs e) { Point dragLocation = new Point(e.X, e.Y); TreeNode node = treeViewMain.GetNodeAt(treeViewMain.PointToClient(dragLocation)); treeViewMain.SelectedNode = node.IsTagOfType() ? null : node; - } + } private void treeViewMain_DragEnter(object sender, DragEventArgs e) { e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : e.AllowedEffect; - } + BringToFront(); + FocusMe(); + treeViewMain.Focus(); + } private void treeViewMain_DragDrop(object sender, DragEventArgs e) { - // Retrieve the client coordinates of the drop location. - Point dragLocation = new Point(e.X, e.Y); + // Retrieve the client coordinates of the drop location. + Point dragLocation = new Point(e.X, e.Y); Point targetPoint = treeViewMain.PointToClient(dragLocation); if (!treeViewMain.ClientRectangle.Contains(targetPoint)) @@ -1383,12 +1387,12 @@ private void ImportFiles(string baseDirectory, IEnumerable files, string if (askForAssetType) { using AddFilePrompt addFile = new AddFilePrompt(assetPath); - if (addFile.ShowDialog(this) != DialogResult.OK) + if (addFile.ShowDialog(this) != DialogResult.OK) { skippedFiles++; skipAttempts--; if (skipAttempts > 0) - continue; + continue; int remainingFileCount = fileCount - addedCount - skippedFiles; DialogResult abortFurtherImport = MessageBox.Show($"Do you wan't to abort further file imports?\n{remainingFileCount} file(s) left.", "Abort further import", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); @@ -1411,7 +1415,7 @@ private void ImportFiles(string baseDirectory, IEnumerable files, string { DialogResult useSameTypeForRest = MessageBox.Show($"Do you want to import all remaining files as {lastSelectedAssetType}?", "Import all as", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (useSameTypeForRest == DialogResult.Yes) - { + { askForAssetType = false; } } @@ -1437,8 +1441,8 @@ private void ImportFiles(string baseDirectory, IEnumerable files, string if (addedCount > 0) { wasModified = true; - BuildMainTreeView(); - } + BuildMainTreeView(); + } } #endregion @@ -1518,7 +1522,7 @@ private void skinPackToolStripMenuItem_Click(object sender, EventArgs e) { currentPCK = InitializePack(new Random().Next(8000, int.MaxValue), 0, namePrompt.NewText, true); MarkTemplateFile(); - LoadEditorTab(); + LoadEditorTab(); } } @@ -1527,14 +1531,14 @@ private void texturePackToolStripMenuItem_Click(object sender, EventArgs e) CheckSaveState(); CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt(); if (packPrompt.ShowDialog(this) == DialogResult.OK) - { - currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes, packPrompt.CreateSkinsPck); + { + currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes, packPrompt.CreateSkinsPck); MarkTemplateFile(); - LoadEditorTab(); - } - } + LoadEditorTab(); + } + } - private void mashUpPackToolStripMenuItem_Click(object sender, EventArgs e) + private void mashUpPackToolStripMenuItem_Click(object sender, EventArgs e) { CheckSaveState(); CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt(); @@ -1542,7 +1546,7 @@ private void mashUpPackToolStripMenuItem_Click(object sender, EventArgs e) { currentPCK = InitializeMashUpPack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes); MarkTemplateFile(); - LoadEditorTab(); + LoadEditorTab(); } } @@ -1551,7 +1555,7 @@ private void MarkTemplateFile() isTemplateFile = true; wasModified = true; saveLocation = string.Empty; - } + } private void quickChangeToolStripMenuItem_Click(object sender, EventArgs e) {