From 7c9d11756e566fb15bbc4ec1475680b16880a635 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 18 Dec 2017 10:59:25 +0100 Subject: [PATCH 1/4] Add the ability to change what text is displayed when a ProgressNotification finishes its task. --- osu.Game/Overlays/Notifications/ProgressNotification.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index 58aff16de0..12c7fe64ba 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Notifications } } + public string CompletionText { get; set; } = "Task has completed!"; + public float Progress { get { return progressBar.Progress; } @@ -87,7 +89,7 @@ namespace osu.Game.Overlays.Notifications protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification { Activated = CompletionClickAction, - Text = "Task has completed!" + Text = CompletionText }; protected virtual void Completed() From f89848152363d8558f29e5f730cac579b17689fb Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 18 Dec 2017 11:14:07 +0100 Subject: [PATCH 2/4] Changed existing implementations to have a custom CompletionText --- osu.Desktop/Overlays/VersionManager.cs | 6 +++++- osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs | 12 ++++++++++-- osu.Game/Beatmaps/BeatmapManager.cs | 5 ++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 9e13003c3f..94c09c2624 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -156,7 +156,11 @@ namespace osu.Desktop.Overlays if (notification == null) { - notification = new UpdateProgressNotification { State = ProgressNotificationState.Active }; + notification = new UpdateProgressNotification + { + CompletionText = "Successfully updated the game!", + State = ProgressNotificationState.Active + }; Schedule(() => notificationOverlay.Post(notification)); } diff --git a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs index 3dca860909..b0141649f2 100644 --- a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs @@ -82,7 +82,11 @@ namespace osu.Game.Tests.Visual private void sendProgress2() { - var n = new ProgressNotification { Text = @"Downloading Haitai..." }; + var n = new ProgressNotification + { + Text = @"Downloading Haitai...", + CompletionText = "Downloaded Haitai!", + }; manager.Post(n); progressingNotifications.Add(n); } @@ -91,7 +95,11 @@ namespace osu.Game.Tests.Visual private void sendProgress1() { - var n = new ProgressNotification { Text = @"Uploading to BSS..." }; + var n = new ProgressNotification + { + Text = @"Uploading to BSS...", + CompletionText = "Uploaded to BSS!", + }; manager.Post(n); progressingNotifications.Add(n); } diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index c4b2c93d7e..93ceefa74b 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -134,6 +134,7 @@ namespace osu.Game.Beatmaps var notification = new ProgressNotification { Text = "Beatmap import is initialising...", + CompletionText = "Import successful!", Progress = 0, State = ProgressNotificationState.Active, }; @@ -245,8 +246,9 @@ namespace osu.Game.Beatmaps return; } - ProgressNotification downloadNotification = new ProgressNotification + var downloadNotification = new ProgressNotification { + CompletionText = $"Installed {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!", Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}", }; @@ -665,6 +667,7 @@ namespace osu.Game.Beatmaps var notification = new ProgressNotification { Progress = 0, + CompletionText = "Deleted all beatmaps!", State = ProgressNotificationState.Active, }; From 3644eda9a989c9dfab62311d56d64ec321a16c5b Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 19 Dec 2017 11:34:23 +0100 Subject: [PATCH 3/4] Changed notification from "installed" to "imported" on beatmap download --- osu.Game/Beatmaps/BeatmapManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 93ceefa74b..a1ad708304 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -248,7 +248,7 @@ namespace osu.Game.Beatmaps var downloadNotification = new ProgressNotification { - CompletionText = $"Installed {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!", + CompletionText = $"Imported {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!", Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}", }; From b91090a4e16670cd97bac454aa01c5fadb029927 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 19 Dec 2017 16:51:36 +0100 Subject: [PATCH 4/4] Reverted update notification to original implementation --- osu.Desktop/Overlays/VersionManager.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 94c09c2624..9e13003c3f 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -156,11 +156,7 @@ namespace osu.Desktop.Overlays if (notification == null) { - notification = new UpdateProgressNotification - { - CompletionText = "Successfully updated the game!", - State = ProgressNotificationState.Active - }; + notification = new UpdateProgressNotification { State = ProgressNotificationState.Active }; Schedule(() => notificationOverlay.Post(notification)); }