mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 00:42:55 +08:00
Merge pull request #1707 from FreezyLemon/customize-progress-notification
Make completion notification text for ProgressNotifications customisable
This commit is contained in:
commit
cee39af08e
@ -82,7 +82,11 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
private void sendProgress2()
|
private void sendProgress2()
|
||||||
{
|
{
|
||||||
var n = new ProgressNotification { Text = @"Downloading Haitai..." };
|
var n = new ProgressNotification
|
||||||
|
{
|
||||||
|
Text = @"Downloading Haitai...",
|
||||||
|
CompletionText = "Downloaded Haitai!",
|
||||||
|
};
|
||||||
manager.Post(n);
|
manager.Post(n);
|
||||||
progressingNotifications.Add(n);
|
progressingNotifications.Add(n);
|
||||||
}
|
}
|
||||||
@ -91,7 +95,11 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
private void sendProgress1()
|
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);
|
manager.Post(n);
|
||||||
progressingNotifications.Add(n);
|
progressingNotifications.Add(n);
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,7 @@ namespace osu.Game.Beatmaps
|
|||||||
var notification = new ProgressNotification
|
var notification = new ProgressNotification
|
||||||
{
|
{
|
||||||
Text = "Beatmap import is initialising...",
|
Text = "Beatmap import is initialising...",
|
||||||
|
CompletionText = "Import successful!",
|
||||||
Progress = 0,
|
Progress = 0,
|
||||||
State = ProgressNotificationState.Active,
|
State = ProgressNotificationState.Active,
|
||||||
};
|
};
|
||||||
@ -245,8 +246,9 @@ namespace osu.Game.Beatmaps
|
|||||||
return;
|
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}",
|
Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}",
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -665,6 +667,7 @@ namespace osu.Game.Beatmaps
|
|||||||
var notification = new ProgressNotification
|
var notification = new ProgressNotification
|
||||||
{
|
{
|
||||||
Progress = 0,
|
Progress = 0,
|
||||||
|
CompletionText = "Deleted all beatmaps!",
|
||||||
State = ProgressNotificationState.Active,
|
State = ProgressNotificationState.Active,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string CompletionText { get; set; } = "Task has completed!";
|
||||||
|
|
||||||
public float Progress
|
public float Progress
|
||||||
{
|
{
|
||||||
get { return progressBar.Progress; }
|
get { return progressBar.Progress; }
|
||||||
@ -87,7 +89,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification
|
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification
|
||||||
{
|
{
|
||||||
Activated = CompletionClickAction,
|
Activated = CompletionClickAction,
|
||||||
Text = "Task has completed!"
|
Text = CompletionText
|
||||||
};
|
};
|
||||||
|
|
||||||
protected virtual void Completed()
|
protected virtual void Completed()
|
||||||
|
Loading…
Reference in New Issue
Block a user