From a12c47536b4158561d26315e004ad2476c748523 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 16 Jul 2018 13:00:21 +0900 Subject: [PATCH] Change default to being important --- osu.Desktop/Overlays/VersionManager.cs | 2 -- osu.Desktop/Updater/SimpleUpdateManager.cs | 7 +------ osu.Game/Beatmaps/BeatmapManager.cs | 18 +++++++++++++++++- osu.Game/Database/ArchiveModelManager.cs | 7 +------ .../Overlays/Notifications/Notification.cs | 2 +- .../ProgressCompletionNotification.cs | 2 -- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 0c564f8113..1129969694 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -111,8 +111,6 @@ namespace osu.Desktop.Overlays private class UpdateCompleteNotification : SimpleNotification { - public override bool IsImportant => true; - public UpdateCompleteNotification(string version, Action openUrl = null) { Text = $"You are now running osu!lazer {version}.\nClick to see what's new!"; diff --git a/osu.Desktop/Updater/SimpleUpdateManager.cs b/osu.Desktop/Updater/SimpleUpdateManager.cs index 5b62298010..6c363422f7 100644 --- a/osu.Desktop/Updater/SimpleUpdateManager.cs +++ b/osu.Desktop/Updater/SimpleUpdateManager.cs @@ -48,7 +48,7 @@ namespace osu.Desktop.Updater if (latest.TagName != version) { - notificationOverlay.Post(new UpdateNotification + notificationOverlay.Post(new SimpleNotification { Text = $"A newer release of osu! has been found ({version} → {latest.TagName}).\n\n" + "Click here to download the new version, which can be installed over the top of your existing installation", @@ -62,11 +62,6 @@ namespace osu.Desktop.Updater } } - private class UpdateNotification : SimpleNotification - { - public override bool IsImportant => true; - } - private string getBestUrl(GitHubRelease release) { GitHubAsset bestAsset = null; diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index fc4d43080e..49aa4eca28 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -143,7 +143,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}", @@ -453,5 +453,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; + } + } } } diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index c5591c00dc..cbf0df3227 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -116,7 +116,7 @@ namespace osu.Game.Database /// One or more archive locations on disk. public void Import(params string[] paths) { - var notification = new ImportNotification + var notification = new ProgressNotification { Text = "Import is initialising...", Progress = 0, @@ -407,10 +407,5 @@ 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; - } } } diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs index c98ac3b2cd..3a3fcb54e0 100644 --- a/osu.Game/Overlays/Notifications/Notification.cs +++ b/osu.Game/Overlays/Notifications/Notification.cs @@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Notifications /// /// Whether this notification should forcefully display itself. /// - public virtual bool IsImportant => false; + public virtual bool IsImportant => true; /// /// Run on user activating the notification. Return true to close. diff --git a/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs b/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs index cd72049702..0711e49608 100644 --- a/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs @@ -9,8 +9,6 @@ namespace osu.Game.Overlays.Notifications { public class ProgressCompletionNotification : SimpleNotification { - public override bool IsImportant => true; - public ProgressCompletionNotification() { Icon = FontAwesome.fa_check;