From 3e0809ec0ad0a9c58629d5bac45d8b1190a0c4ea Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Tue, 22 Oct 2024 14:16:11 +0200 Subject: [PATCH] improve delete assets confirm dialog - Improve visual spacing - Improve grammar and reduce word count - Make prompt respect asset count --- Source/Editor/Windows/ContentWindow.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index bb7c594b3..90da6735b 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -638,12 +638,14 @@ namespace FlaxEditor.Windows var toDelete = new List(items); toDelete.Sort((a, b) => a.IsFolder ? 1 : b.IsFolder ? -1 : a.Compare(b)); + string singularPlural = toDelete.Count > 1 ? "s" : ""; + string msg = toDelete.Count == 1 - ? string.Format("Are you sure to delete \'{0}\'?\nThis action cannot be undone. Files will be deleted permanently.", items[0].Path) - : string.Format("Are you sure to delete {0} selected items?\nThis action cannot be undone. Files will be deleted permanently.", items.Count); + ? string.Format("Delete \'{0}\'?\n\nThis action cannot be undone.\nFiles will be deleted permanently.", items[0].Path) + : string.Format("Delete {0} selected items?\n\nThis action cannot be undone.\nFiles will be deleted permanently.", items.Count); // Ask user - if (MessageBox.Show(msg, "Delete asset(s)", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) + if (MessageBox.Show(msg, "Delete asset" + singularPlural, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) return; // Clear navigation