From 041eb43462655e11c2ad94d44669898bb2a3b9b9 Mon Sep 17 00:00:00 2001 From: MattNL Date: Mon, 13 Nov 2023 19:02:41 -0500 Subject: [PATCH] Fixed rename "deleting" files with identical names --- PCK-Studio/MainForm.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 4fcf1dfe..fb74cc44 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -749,6 +749,13 @@ namespace PckStudio if (diag.ShowDialog(this) == DialogResult.OK) { + PckFileData test; + if (currentPCK.TryGetFile(diag.NewText, (node.Tag as PckFileData).Filetype, out test)) + { + MessageBox.Show($"{diag.NewText} already exists", "File already exists"); + return; + } + if (node.Tag is PckFileData file) { file.Filename = diag.NewText; @@ -760,6 +767,7 @@ namespace PckStudio { if (childNode.Tag is PckFileData folderFile) { + if (folderFile.Filename == diag.NewText) continue; folderFile.Filename = childNode.FullPath; } }