mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:07:52 +08:00
Remove the ability to cancel all "in progress" tasks
This commit is contained in:
parent
001d09057e
commit
070b3883ce
@ -29,11 +29,6 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString ClearAll => new TranslatableString(getKey(@"clear_all"), @"Clear All");
|
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>
|
/// <summary>
|
||||||
/// "Your battery level is low! Charge your device to prevent interruptions during gameplay."
|
/// "Your battery level is low! Charge your device to prevent interruptions during gameplay."
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -108,8 +108,8 @@ namespace osu.Game.Overlays
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, NotificationsStrings.ClearAll),
|
new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, true),
|
||||||
new NotificationSection(NotificationsStrings.RunningTasks, new[] { typeof(ProgressNotification) }, NotificationsStrings.CancelAll),
|
new NotificationSection(NotificationsStrings.RunningTasks, new[] { typeof(ProgressNotification) }, false),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ using osu.Framework.Localisation;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Localisation;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Notifications
|
namespace osu.Game.Overlays.Notifications
|
||||||
@ -38,16 +39,16 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public IEnumerable<Type> AcceptedNotificationTypes { get; }
|
public IEnumerable<Type> AcceptedNotificationTypes { get; }
|
||||||
|
|
||||||
private readonly LocalisableString clearButtonText;
|
|
||||||
|
|
||||||
private readonly LocalisableString titleText;
|
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();
|
AcceptedNotificationTypes = acceptedNotificationTypes.ToArray();
|
||||||
|
|
||||||
this.clearButtonText = clearButtonText.ToUpper();
|
|
||||||
titleText = title;
|
titleText = title;
|
||||||
|
this.allowClear = allowClear;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -71,15 +72,17 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Children = new Drawable[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new ClearAllButton
|
allowClear
|
||||||
{
|
? new ClearAllButton
|
||||||
Text = clearButtonText,
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Text = NotificationsStrings.ClearAll,
|
||||||
Origin = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Action = clearAll
|
Origin = Anchor.TopRight,
|
||||||
},
|
Action = clearAll
|
||||||
|
}
|
||||||
|
: Empty(),
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding
|
Margin = new MarginPadding
|
||||||
@ -115,10 +118,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearAll()
|
private void clearAll() => notifications.Children.ForEach(c => c.Close(true));
|
||||||
{
|
|
||||||
notifications.Children.ForEach(c => c.Close(true));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user