1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-24 19:50:38 +08:00

Add feedback to delete button even when no-op

This commit is contained in:
Brandon
2024-02-18 21:52:23 -08:00
Unverified
parent ef2e2302d4
commit c6ca812ea0
2 changed files with 21 additions and 4 deletions
+9 -2
View File
@@ -361,13 +361,20 @@ namespace osu.Game.Beatmaps
/// </summary>
public void DeleteVideos(List<BeatmapSetInfo> 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,
};
+12 -2
View File
@@ -105,7 +105,12 @@ namespace osu.Game.Database
/// </summary>
public void Delete(List<TModel> 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
/// </summary>
public void Undelete(List<TModel> 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
{