1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Merge pull request #1707 from FreezyLemon/customize-progress-notification

Make completion notification text for ProgressNotifications customisable
This commit is contained in:
Dean Herbert 2017-12-20 20:15:48 +09:00 committed by GitHub
commit cee39af08e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View File

@ -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);
}

View File

@ -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 = $"Imported {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,
};

View File

@ -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()