mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 10:03:05 +08:00
Add feedback to delete button even when no-op
This commit is contained in:
parent
ef2e2302d4
commit
c6ca812ea0
@ -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,
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user