1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-02 18:19:59 +08:00

Merge remote-tracking branch 'origin/make-notifications-quieter' into release

This commit is contained in:
Dean Herbert
2018-07-14 02:33:15 +09:00
Unverified
4 changed files with 15 additions and 2 deletions
+2
View File
@@ -111,6 +111,8 @@ namespace osu.Desktop.Overlays
private class UpdateCompleteNotification : SimpleNotification
{
public override bool IsImportant => true;
public UpdateCompleteNotification(string version, Action<string> openUrl = null)
{
Text = $"You are now running osu!lazer {version}.\nClick to see what's new!";
+6 -1
View File
@@ -116,7 +116,7 @@ namespace osu.Game.Database
/// <param name="paths">One or more archive locations on disk.</param>
public void Import(params string[] paths)
{
var notification = new ProgressNotification
var notification = new ImportNotification
{
Text = "Import is initialising...",
Progress = 0,
@@ -407,5 +407,10 @@ namespace osu.Game.Database
return new LegacyFilesystemReader(path);
throw new InvalidFormatException($"{path} is not a valid archive");
}
private class ImportNotification : ProgressNotification
{
public override bool IsImportant => true;
}
}
}
+2 -1
View File
@@ -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 => false;
/// <summary>
/// Run on user activating the notification. Return true to close.
/// </summary>