mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 14:25:10 +08:00
Merge pull request #30133 from peppy/delete-header-text
Fix delete dialogs having generic "Caution" header text
This commit is contained in:
commit
958ee8a651
@ -2,18 +2,16 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
using osu.Game.Tournament.Models;
|
using osu.Game.Tournament.Models;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Screens.Editors.Components
|
namespace osu.Game.Tournament.Screens.Editors.Components
|
||||||
{
|
{
|
||||||
public partial class DeleteRoundDialog : DangerousActionDialog
|
public partial class DeleteRoundDialog : DeletionDialog
|
||||||
{
|
{
|
||||||
public DeleteRoundDialog(TournamentRound round, Action action)
|
public DeleteRoundDialog(TournamentRound round, Action action)
|
||||||
{
|
{
|
||||||
HeaderText = round.Name.Value.Length > 0 ? $@"Delete round ""{round.Name.Value}""?" : @"Delete unnamed round?";
|
HeaderText = round.Name.Value.Length > 0 ? $@"Delete round ""{round.Name.Value}""?" : @"Delete unnamed round?";
|
||||||
Icon = FontAwesome.Solid.Trash;
|
|
||||||
DangerousAction = action;
|
DangerousAction = action;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,20 +2,18 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
using osu.Game.Tournament.Models;
|
using osu.Game.Tournament.Models;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Screens.Editors.Components
|
namespace osu.Game.Tournament.Screens.Editors.Components
|
||||||
{
|
{
|
||||||
public partial class DeleteTeamDialog : DangerousActionDialog
|
public partial class DeleteTeamDialog : DeletionDialog
|
||||||
{
|
{
|
||||||
public DeleteTeamDialog(TournamentTeam team, Action action)
|
public DeleteTeamDialog(TournamentTeam team, Action action)
|
||||||
{
|
{
|
||||||
HeaderText = team.FullName.Value.Length > 0 ? $@"Delete team ""{team.FullName.Value}""?" :
|
HeaderText = team.FullName.Value.Length > 0 ? $@"Delete team ""{team.FullName.Value}""?" :
|
||||||
team.Acronym.Value.Length > 0 ? $@"Delete team ""{team.Acronym.Value}""?" :
|
team.Acronym.Value.Length > 0 ? $@"Delete team ""{team.Acronym.Value}""?" :
|
||||||
@"Delete unnamed team?";
|
@"Delete unnamed team?";
|
||||||
Icon = FontAwesome.Solid.Trash;
|
|
||||||
DangerousAction = action;
|
DangerousAction = action;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ using osu.Game.Overlays.Dialog;
|
|||||||
|
|
||||||
namespace osu.Game.Collections
|
namespace osu.Game.Collections
|
||||||
{
|
{
|
||||||
public partial class DeleteCollectionDialog : DangerousActionDialog
|
public partial class DeleteCollectionDialog : DeletionDialog
|
||||||
{
|
{
|
||||||
public DeleteCollectionDialog(Live<BeatmapCollection> collection, Action deleteAction)
|
public DeleteCollectionDialog(Live<BeatmapCollection> collection, Action deleteAction)
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,12 @@ namespace osu.Game.Localisation
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Caution"
|
/// "Caution"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString Caution => new TranslatableString(getKey(@"header_text"), @"Caution");
|
public static LocalisableString CautionHeaderText => new TranslatableString(getKey(@"header_text"), @"Caution");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Are you sure you want to delete the following:"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString DeletionHeaderText => new TranslatableString(getKey(@"deletion_header_text"), @"Are you sure you want to delete the following:");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Yes. Go for it."
|
/// "Yes. Go for it."
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Online.Chat
|
|||||||
{
|
{
|
||||||
public ExternalLinkDialog(string url, Action openExternalLinkAction, Action copyExternalLinkAction)
|
public ExternalLinkDialog(string url, Action openExternalLinkAction, Action copyExternalLinkAction)
|
||||||
{
|
{
|
||||||
HeaderText = DialogStrings.Caution;
|
HeaderText = DialogStrings.CautionHeaderText;
|
||||||
BodyText = $"Are you sure you want to open the following link in a web browser?\n\n{url}";
|
BodyText = $"Are you sure you want to open the following link in a web browser?\n\n{url}";
|
||||||
|
|
||||||
Icon = FontAwesome.Solid.ExclamationTriangle;
|
Icon = FontAwesome.Solid.ExclamationTriangle;
|
||||||
|
@ -30,9 +30,9 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
|
|
||||||
protected DangerousActionDialog()
|
protected DangerousActionDialog()
|
||||||
{
|
{
|
||||||
HeaderText = DialogStrings.Caution;
|
HeaderText = DialogStrings.CautionHeaderText;
|
||||||
|
|
||||||
Icon = FontAwesome.Regular.TrashAlt;
|
Icon = FontAwesome.Solid.ExclamationTriangle;
|
||||||
|
|
||||||
Buttons = new PopupDialogButton[]
|
Buttons = new PopupDialogButton[]
|
||||||
{
|
{
|
||||||
|
20
osu.Game/Overlays/Dialog/DeletionDialog.cs
Normal file
20
osu.Game/Overlays/Dialog/DeletionDialog.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// 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.Graphics.Sprites;
|
||||||
|
using osu.Game.Localisation;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Dialog
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A dialog which provides confirmation for deletion of something.
|
||||||
|
/// </summary>
|
||||||
|
public abstract partial class DeletionDialog : DangerousActionDialog
|
||||||
|
{
|
||||||
|
protected DeletionDialog()
|
||||||
|
{
|
||||||
|
HeaderText = DialogStrings.DeletionHeaderText;
|
||||||
|
Icon = FontAwesome.Solid.Trash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods
|
||||||
{
|
{
|
||||||
public partial class DeleteModPresetDialog : DangerousActionDialog
|
public partial class DeleteModPresetDialog : DeletionDialog
|
||||||
{
|
{
|
||||||
public DeleteModPresetDialog(Live<ModPreset> modPreset)
|
public DeleteModPresetDialog(Live<ModPreset> modPreset)
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
public MassDeleteConfirmationDialog(Action deleteAction, LocalisableString deleteContent)
|
public MassDeleteConfirmationDialog(Action deleteAction, LocalisableString deleteContent)
|
||||||
{
|
{
|
||||||
BodyText = deleteContent;
|
BodyText = deleteContent;
|
||||||
|
Icon = FontAwesome.Solid.Trash;
|
||||||
DangerousAction = deleteAction;
|
DangerousAction = deleteAction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ using osu.Game.Overlays.Dialog;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Edit
|
namespace osu.Game.Screens.Edit
|
||||||
{
|
{
|
||||||
public partial class DeleteDifficultyConfirmationDialog : DangerousActionDialog
|
public partial class DeleteDifficultyConfirmationDialog : DeletionDialog
|
||||||
{
|
{
|
||||||
public DeleteDifficultyConfirmationDialog(BeatmapInfo beatmapInfo, Action deleteAction)
|
public DeleteDifficultyConfirmationDialog(BeatmapInfo beatmapInfo, Action deleteAction)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@ using osu.Game.Overlays.Dialog;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
public partial class BeatmapDeleteDialog : DangerousActionDialog
|
public partial class BeatmapDeleteDialog : DeletionDialog
|
||||||
{
|
{
|
||||||
private readonly BeatmapSetInfo beatmapSet;
|
private readonly BeatmapSetInfo beatmapSet;
|
||||||
|
|
||||||
|
@ -4,11 +4,10 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
public partial class LocalScoreDeleteDialog : DangerousActionDialog
|
public partial class LocalScoreDeleteDialog : DeletionDialog
|
||||||
{
|
{
|
||||||
private readonly ScoreInfo score;
|
private readonly ScoreInfo score;
|
||||||
|
|
||||||
@ -21,8 +20,6 @@ namespace osu.Game.Screens.Select
|
|||||||
private void load(ScoreManager scoreManager)
|
private void load(ScoreManager scoreManager)
|
||||||
{
|
{
|
||||||
BodyText = $"{score.User} ({score.DisplayAccuracy}, {score.Rank})";
|
BodyText = $"{score.User} ({score.DisplayAccuracy}, {score.Rank})";
|
||||||
|
|
||||||
Icon = FontAwesome.Regular.TrashAlt;
|
|
||||||
DangerousAction = () => scoreManager.Delete(score);
|
DangerousAction = () => scoreManager.Delete(score);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ using osu.Game.Overlays.Dialog;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
public partial class SkinDeleteDialog : DangerousActionDialog
|
public partial class SkinDeleteDialog : DeletionDialog
|
||||||
{
|
{
|
||||||
private readonly Skin skin;
|
private readonly Skin skin;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user