mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 04:13:11 +08:00
Make notifications less noisy
This commit is contained in:
parent
d08c44a726
commit
ac4f25c5bc
@ -111,6 +111,8 @@ namespace osu.Desktop.Overlays
|
|||||||
|
|
||||||
private class UpdateCompleteNotification : SimpleNotification
|
private class UpdateCompleteNotification : SimpleNotification
|
||||||
{
|
{
|
||||||
|
public override bool IsImportant => true;
|
||||||
|
|
||||||
public UpdateCompleteNotification(string version, Action<string> openUrl = null)
|
public UpdateCompleteNotification(string version, Action<string> openUrl = null)
|
||||||
{
|
{
|
||||||
Text = $"You are now running osu!lazer {version}.\nClick to see what's new!";
|
Text = $"You are now running osu!lazer {version}.\nClick to see what's new!";
|
||||||
|
@ -116,7 +116,7 @@ namespace osu.Game.Database
|
|||||||
/// <param name="paths">One or more archive locations on disk.</param>
|
/// <param name="paths">One or more archive locations on disk.</param>
|
||||||
public void Import(params string[] paths)
|
public void Import(params string[] paths)
|
||||||
{
|
{
|
||||||
var notification = new ProgressNotification
|
var notification = new ImportNotification
|
||||||
{
|
{
|
||||||
Text = "Import is initialising...",
|
Text = "Import is initialising...",
|
||||||
Progress = 0,
|
Progress = 0,
|
||||||
@ -407,5 +407,10 @@ namespace osu.Game.Database
|
|||||||
return new LegacyFilesystemReader(path);
|
return new LegacyFilesystemReader(path);
|
||||||
throw new InvalidFormatException($"{path} is not a valid archive");
|
throw new InvalidFormatException($"{path} is not a valid archive");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ImportNotification : ProgressNotification
|
||||||
|
{
|
||||||
|
public override bool IsImportant => true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,8 @@ namespace osu.Game.Overlays
|
|||||||
var section = sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)));
|
var section = sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)));
|
||||||
section?.Add(notification, notification.DisplayOnTop ? -runningDepth : runningDepth);
|
section?.Add(notification, notification.DisplayOnTop ? -runningDepth : runningDepth);
|
||||||
|
|
||||||
State = Visibility.Visible;
|
if (notification.IsImportant)
|
||||||
|
State = Visibility.Visible;
|
||||||
|
|
||||||
updateCounts();
|
updateCounts();
|
||||||
});
|
});
|
||||||
|
@ -23,6 +23,11 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action Closed;
|
public event Action Closed;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this notification should forcefully display itself.
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool IsImportant => false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Run on user activating the notification. Return true to close.
|
/// Run on user activating the notification. Return true to close.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user