1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 16:13:34 +08:00

Remove the ability to cancel all "in progress" tasks

This commit is contained in:
Dean Herbert 2023-07-07 00:31:32 +09:00
parent 001d09057e
commit 070b3883ce
3 changed files with 18 additions and 23 deletions

View File

@ -29,11 +29,6 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString ClearAll => new TranslatableString(getKey(@"clear_all"), @"Clear All");
/// <summary>
/// "Cancel All"
/// </summary>
public static LocalisableString CancelAll => new TranslatableString(getKey(@"cancel_all"), @"Cancel All");
/// <summary>
/// "Your battery level is low! Charge your device to prevent interruptions during gameplay."
/// </summary>

View File

@ -108,8 +108,8 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.X,
Children = new[]
{
new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, NotificationsStrings.ClearAll),
new NotificationSection(NotificationsStrings.RunningTasks, new[] { typeof(ProgressNotification) }, NotificationsStrings.CancelAll),
new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, true),
new NotificationSection(NotificationsStrings.RunningTasks, new[] { typeof(ProgressNotification) }, false),
}
}
}

View File

@ -13,6 +13,7 @@ using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Localisation;
using osuTK;
namespace osu.Game.Overlays.Notifications
@ -38,16 +39,16 @@ namespace osu.Game.Overlays.Notifications
public IEnumerable<Type> AcceptedNotificationTypes { get; }
private readonly LocalisableString clearButtonText;
private readonly LocalisableString titleText;
public NotificationSection(LocalisableString title, IEnumerable<Type> acceptedNotificationTypes, LocalisableString clearButtonText)
private readonly bool allowClear;
public NotificationSection(LocalisableString title, IEnumerable<Type> acceptedNotificationTypes, bool allowClear)
{
AcceptedNotificationTypes = acceptedNotificationTypes.ToArray();
this.clearButtonText = clearButtonText.ToUpper();
titleText = title;
this.allowClear = allowClear;
}
[BackgroundDependencyLoader]
@ -71,15 +72,17 @@ namespace osu.Game.Overlays.Notifications
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
Children = new[]
{
new ClearAllButton
{
Text = clearButtonText,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Action = clearAll
},
allowClear
? new ClearAllButton
{
Text = NotificationsStrings.ClearAll,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Action = clearAll
}
: Empty(),
new FillFlowContainer
{
Margin = new MarginPadding
@ -115,10 +118,7 @@ namespace osu.Game.Overlays.Notifications
});
}
private void clearAll()
{
notifications.Children.ForEach(c => c.Close(true));
}
private void clearAll() => notifications.Children.ForEach(c => c.Close(true));
protected override void Update()
{