mirror of
https://github.com/ppy/osu.git
synced 2024-09-22 03:27:24 +08:00
Merge pull request #3031 from peppy/make-notifications-quieter
Make notifications less noisy
This commit is contained in:
commit
f153f39596
@ -148,7 +148,7 @@ namespace osu.Game.Beatmaps
|
||||
return;
|
||||
}
|
||||
|
||||
var downloadNotification = new ProgressNotification
|
||||
var downloadNotification = new DownloadNotification
|
||||
{
|
||||
CompletionText = $"Imported {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!",
|
||||
Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}",
|
||||
@ -460,5 +460,21 @@ namespace osu.Game.Beatmaps
|
||||
protected override Texture GetBackground() => null;
|
||||
protected override Track GetTrack() => null;
|
||||
}
|
||||
|
||||
private class DownloadNotification : ProgressNotification
|
||||
{
|
||||
public override bool IsImportant => false;
|
||||
|
||||
protected override Notification CreateCompletionNotification() => new SilencedProgressCompletionNotification
|
||||
{
|
||||
Activated = CompletionClickAction,
|
||||
Text = CompletionText
|
||||
};
|
||||
|
||||
private class SilencedProgressCompletionNotification : ProgressCompletionNotification
|
||||
{
|
||||
public override bool IsImportant => false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,8 @@ namespace osu.Game.Overlays
|
||||
var section = sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)));
|
||||
section?.Add(notification, notification.DisplayOnTop ? -runningDepth : runningDepth);
|
||||
|
||||
State = Visibility.Visible;
|
||||
if (notification.IsImportant)
|
||||
State = Visibility.Visible;
|
||||
|
||||
updateCounts();
|
||||
});
|
||||
|
@ -23,6 +23,11 @@ namespace osu.Game.Overlays.Notifications
|
||||
/// </summary>
|
||||
public event Action Closed;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this notification should forcefully display itself.
|
||||
/// </summary>
|
||||
public virtual bool IsImportant => true;
|
||||
|
||||
/// <summary>
|
||||
/// Run on user activating the notification. Return true to close.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user