From c6ca812ea07eb9fdfc24038e05f4b485e9501775 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sun, 18 Feb 2024 21:52:23 -0800 Subject: [PATCH] Add feedback to delete button even when no-op --- osu.Game/Beatmaps/BeatmapManager.cs | 11 +++++++++-- osu.Game/Database/ModelManager.cs | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 1f551f1218..3aed15029d 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -361,13 +361,20 @@ namespace osu.Game.Beatmaps /// public void DeleteVideos(List items, bool silent = false) { - if (items.Count == 0) return; + var noVideosMessage = "No videos found to delete!"; + + if (items.Count == 0) + { + if (!silent) + PostNotification?.Invoke(new ProgressCompletionNotification { Text = noVideosMessage }); + return; + } var notification = new ProgressNotification { Progress = 0, Text = $"Preparing to delete all {HumanisedModelName} videos...", - CompletionText = "No videos found to delete!", + CompletionText = noVideosMessage, State = ProgressNotificationState.Active, }; diff --git a/osu.Game/Database/ModelManager.cs b/osu.Game/Database/ModelManager.cs index 39dae61d36..7a5fb5efbf 100644 --- a/osu.Game/Database/ModelManager.cs +++ b/osu.Game/Database/ModelManager.cs @@ -105,7 +105,12 @@ namespace osu.Game.Database /// public void Delete(List items, bool silent = false) { - if (items.Count == 0) return; + if (items.Count == 0) + { + if (!silent) + PostNotification?.Invoke(new ProgressCompletionNotification { Text = $"No {HumanisedModelName}s found to delete!" }); + return; + } var notification = new ProgressNotification { @@ -142,7 +147,12 @@ namespace osu.Game.Database /// public void Undelete(List items, bool silent = false) { - if (!items.Any()) return; + if (!items.Any()) + { + if (!silent) + PostNotification?.Invoke(new ProgressCompletionNotification { Text = $"No {HumanisedModelName}s found to restore!" }); + return; + } var notification = new ProgressNotification {