mirror of
https://github.com/ppy/osu
synced 2025-02-24 06:37:03 +00:00
Merge pull request #28122 from Ekischleki/Make-deletion-confirmation-less-confusing
Make deletion confirmation less confusing
This commit is contained in:
commit
7dc238d32c
44
osu.Game/Localisation/DeleteConfirmationContentStrings.cs
Normal file
44
osu.Game/Localisation/DeleteConfirmationContentStrings.cs
Normal file
@ -0,0 +1,44 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Localisation;
|
||||
|
||||
namespace osu.Game.Localisation
|
||||
{
|
||||
public static class DeleteConfirmationContentStrings
|
||||
{
|
||||
private const string prefix = @"osu.Game.Resources.Localisation.DeleteConfirmationContent";
|
||||
|
||||
/// <summary>
|
||||
/// "Are you sure you want to delete all beatmaps?"
|
||||
/// </summary>
|
||||
public static LocalisableString Beatmaps => new TranslatableString(getKey(@"beatmaps"), @"Are you sure you want to delete all beatmaps?");
|
||||
|
||||
/// <summary>
|
||||
/// "Are you sure you want to delete all beatmaps videos? This cannot be undone!"
|
||||
/// </summary>
|
||||
public static LocalisableString BeatmapVideos => new TranslatableString(getKey(@"beatmap_videos"), @"Are you sure you want to delete all beatmaps videos? This cannot be undone!");
|
||||
|
||||
/// <summary>
|
||||
/// "Are you sure you want to delete all skins? This cannot be undone!"
|
||||
/// </summary>
|
||||
public static LocalisableString Skins => new TranslatableString(getKey(@"skins"), @"Are you sure you want to delete all skins? This cannot be undone!");
|
||||
|
||||
/// <summary>
|
||||
/// "Are you sure you want to delete all collections? This cannot be undone!"
|
||||
/// </summary>
|
||||
public static LocalisableString Collections => new TranslatableString(getKey(@"collections"), @"Are you sure you want to delete all collections? This cannot be undone!");
|
||||
|
||||
/// <summary>
|
||||
/// "Are you sure you want to delete all scores? This cannot be undone!"
|
||||
/// </summary>
|
||||
public static LocalisableString Scores => new TranslatableString(getKey(@"collections"), @"Are you sure you want to delete all scores? This cannot be undone!");
|
||||
|
||||
/// <summary>
|
||||
/// "Are you sure you want to delete all mod presets?"
|
||||
/// </summary>
|
||||
public static LocalisableString ModPresets => new TranslatableString(getKey(@"mod_presets"), @"Are you sure you want to delete all mod presets?");
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
@ -10,9 +10,9 @@ namespace osu.Game.Localisation
|
||||
private const string prefix = @"osu.Game.Resources.Localisation.DeleteConfirmationDialog";
|
||||
|
||||
/// <summary>
|
||||
/// "Confirm deletion of"
|
||||
/// "Caution"
|
||||
/// </summary>
|
||||
public static LocalisableString HeaderText => new TranslatableString(getKey(@"header_text"), @"Confirm deletion of");
|
||||
public static LocalisableString HeaderText => new TranslatableString(getKey(@"header_text"), @"Caution");
|
||||
|
||||
/// <summary>
|
||||
/// "Yes. Go for it."
|
||||
|
@ -210,7 +210,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
TextAnchor = Anchor.TopCentre,
|
||||
Padding = new MarginPadding { Horizontal = 5 },
|
||||
Padding = new MarginPadding { Horizontal = 15 },
|
||||
},
|
||||
body = new OsuTextFlowContainer(t => t.Font = t.Font.With(size: 18))
|
||||
{
|
||||
@ -219,7 +219,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
TextAnchor = Anchor.TopCentre,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding { Horizontal = 5 },
|
||||
Padding = new MarginPadding { Horizontal = 15 },
|
||||
},
|
||||
buttonsContainer = new FillFlowContainer<PopupDialogButton>
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
deleteBeatmapsButton.Enabled.Value = false;
|
||||
Task.Run(() => beatmaps.Delete()).ContinueWith(_ => Schedule(() => deleteBeatmapsButton.Enabled.Value = true));
|
||||
}));
|
||||
}, DeleteConfirmationContentStrings.Beatmaps));
|
||||
}
|
||||
});
|
||||
|
||||
@ -40,11 +40,11 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
Text = MaintenanceSettingsStrings.DeleteAllBeatmapVideos,
|
||||
Action = () =>
|
||||
{
|
||||
dialogOverlay?.Push(new MassVideoDeleteConfirmationDialog(() =>
|
||||
dialogOverlay?.Push(new MassDeleteConfirmationDialog(() =>
|
||||
{
|
||||
deleteBeatmapVideosButton.Enabled.Value = false;
|
||||
Task.Run(beatmaps.DeleteAllVideos).ContinueWith(_ => Schedule(() => deleteBeatmapVideosButton.Enabled.Value = true));
|
||||
}));
|
||||
}, DeleteConfirmationContentStrings.BeatmapVideos));
|
||||
}
|
||||
});
|
||||
AddRange(new Drawable[]
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
Text = MaintenanceSettingsStrings.DeleteAllCollections,
|
||||
Action = () =>
|
||||
{
|
||||
dialogOverlay?.Push(new MassDeleteConfirmationDialog(deleteAllCollections));
|
||||
dialogOverlay?.Push(new MassDeleteConfirmationDialog(deleteAllCollections, DeleteConfirmationContentStrings.Collections));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2,15 +2,16 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Overlays.Dialog;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
public partial class MassDeleteConfirmationDialog : DangerousActionDialog
|
||||
{
|
||||
public MassDeleteConfirmationDialog(Action deleteAction)
|
||||
public MassDeleteConfirmationDialog(Action deleteAction, LocalisableString deleteContent)
|
||||
{
|
||||
BodyText = "Everything?";
|
||||
BodyText = deleteContent;
|
||||
DangerousAction = deleteAction;
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
public partial class MassVideoDeleteConfirmationDialog : MassDeleteConfirmationDialog
|
||||
{
|
||||
public MassVideoDeleteConfirmationDialog(Action deleteAction)
|
||||
: base(deleteAction)
|
||||
{
|
||||
BodyText = "All beatmap videos? This cannot be undone!";
|
||||
}
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
deleteAllButton.Enabled.Value = false;
|
||||
Task.Run(deleteAllModPresets).ContinueWith(t => Schedule(onAllModPresetsDeleted, t));
|
||||
}));
|
||||
}, DeleteConfirmationContentStrings.ModPresets));
|
||||
}
|
||||
},
|
||||
undeleteButton = new SettingsButton
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
deleteScoresButton.Enabled.Value = false;
|
||||
Task.Run(() => scores.Delete()).ContinueWith(_ => Schedule(() => deleteScoresButton.Enabled.Value = true));
|
||||
}));
|
||||
}, DeleteConfirmationContentStrings.Scores));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
deleteSkinsButton.Enabled.Value = false;
|
||||
Task.Run(() => skins.Delete()).ContinueWith(_ => Schedule(() => deleteSkinsButton.Enabled.Value = true));
|
||||
}));
|
||||
}, DeleteConfirmationContentStrings.Skins));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user