mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 02:37:25 +09:00
make ResetConfirmDialog
properly utilise its parent's logic
Adjust name of `DeleteAction` to `DangerousAction`
This commit is contained in:
parent
3bff415909
commit
908651cc11
@ -13,7 +13,7 @@ namespace osu.Game.Collections
|
|||||||
public DeleteCollectionDialog(Live<BeatmapCollection> collection, Action deleteAction)
|
public DeleteCollectionDialog(Live<BeatmapCollection> collection, Action deleteAction)
|
||||||
{
|
{
|
||||||
BodyText = collection.PerformRead(c => $"{c.Name} ({"beatmap".ToQuantity(c.BeatmapMD5Hashes.Count)})");
|
BodyText = collection.PerformRead(c => $"{c.Name} ({"beatmap".ToQuantity(c.BeatmapMD5Hashes.Count)})");
|
||||||
DeleteAction = deleteAction;
|
DangerousAction = deleteAction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The action which performs the deletion.
|
/// The action which performs the deletion.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected Action? DeleteAction { get; set; }
|
protected Action? DangerousAction { get; set; }
|
||||||
|
|
||||||
protected DangerousActionDialog()
|
protected DangerousActionDialog()
|
||||||
{
|
{
|
||||||
@ -30,7 +30,7 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
new PopupDialogDangerousButton
|
new PopupDialogDangerousButton
|
||||||
{
|
{
|
||||||
Text = DeleteConfirmationDialogStrings.Confirm,
|
Text = DeleteConfirmationDialogStrings.Confirm,
|
||||||
Action = () => DeleteAction?.Invoke()
|
Action = () => DangerousAction?.Invoke()
|
||||||
},
|
},
|
||||||
new PopupDialogCancelButton
|
new PopupDialogCancelButton
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
public DeleteModPresetDialog(Live<ModPreset> modPreset)
|
public DeleteModPresetDialog(Live<ModPreset> modPreset)
|
||||||
{
|
{
|
||||||
BodyText = modPreset.PerformRead(preset => preset.Name);
|
BodyText = modPreset.PerformRead(preset => preset.Name);
|
||||||
DeleteAction = () => modPreset.PerformWrite(preset => preset.DeletePending = true);
|
DangerousAction = () => modPreset.PerformWrite(preset => preset.DeletePending = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
public MassDeleteConfirmationDialog(Action deleteAction)
|
public MassDeleteConfirmationDialog(Action deleteAction)
|
||||||
{
|
{
|
||||||
BodyText = "Everything?";
|
BodyText = "Everything?";
|
||||||
DeleteAction = deleteAction;
|
DangerousAction = deleteAction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
@ -633,25 +632,11 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
|
|
||||||
public partial class ResetConfirmDialog : DangerousActionDialog
|
public partial class ResetConfirmDialog : DangerousActionDialog
|
||||||
{
|
{
|
||||||
public ResetConfirmDialog(Action reset)
|
public ResetConfirmDialog(Action revert)
|
||||||
{
|
{
|
||||||
HeaderText = SkinEditorStrings.RevertToDefaultDescription;
|
HeaderText = SkinEditorStrings.RevertToDefaultDescription;
|
||||||
BodyText = SkinEditorStrings.ResetDialogue;
|
BodyText = SkinEditorStrings.ResetDialogue;
|
||||||
|
DangerousAction = revert;
|
||||||
Icon = FontAwesome.Solid.ExclamationTriangle;
|
|
||||||
|
|
||||||
Buttons = new PopupDialogButton[]
|
|
||||||
{
|
|
||||||
new PopupDialogDangerousButton
|
|
||||||
{
|
|
||||||
Text = BeatmapOverlayStrings.UserContentConfirmButtonText,
|
|
||||||
Action = reset
|
|
||||||
},
|
|
||||||
new PopupDialogCancelButton
|
|
||||||
{
|
|
||||||
Text = Web.CommonStrings.ButtonsCancel,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
public DeleteDifficultyConfirmationDialog(BeatmapInfo beatmapInfo, Action deleteAction)
|
public DeleteDifficultyConfirmationDialog(BeatmapInfo beatmapInfo, Action deleteAction)
|
||||||
{
|
{
|
||||||
BodyText = $"\"{beatmapInfo.DifficultyName}\" difficulty";
|
BodyText = $"\"{beatmapInfo.DifficultyName}\" difficulty";
|
||||||
DeleteAction = deleteAction;
|
DangerousAction = deleteAction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Screens.Select
|
|||||||
public BeatmapClearScoresDialog(BeatmapInfo beatmapInfo, Action onCompletion)
|
public BeatmapClearScoresDialog(BeatmapInfo beatmapInfo, Action onCompletion)
|
||||||
{
|
{
|
||||||
BodyText = $"All local scores on {beatmapInfo.GetDisplayTitle()}";
|
BodyText = $"All local scores on {beatmapInfo.GetDisplayTitle()}";
|
||||||
DeleteAction = () =>
|
DangerousAction = () =>
|
||||||
{
|
{
|
||||||
Task.Run(() => scoreManager.Delete(beatmapInfo))
|
Task.Run(() => scoreManager.Delete(beatmapInfo))
|
||||||
.ContinueWith(_ => onCompletion);
|
.ContinueWith(_ => onCompletion);
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Screens.Select
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(BeatmapManager beatmapManager)
|
private void load(BeatmapManager beatmapManager)
|
||||||
{
|
{
|
||||||
DeleteAction = () => beatmapManager.Delete(beatmapSet);
|
DangerousAction = () => beatmapManager.Delete(beatmapSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
HeaderText = PopupDialogStrings.UpdateLocallyModifiedText;
|
HeaderText = PopupDialogStrings.UpdateLocallyModifiedText;
|
||||||
BodyText = PopupDialogStrings.UpdateLocallyModifiedDescription;
|
BodyText = PopupDialogStrings.UpdateLocallyModifiedDescription;
|
||||||
Icon = FontAwesome.Solid.ExclamationTriangle;
|
Icon = FontAwesome.Solid.ExclamationTriangle;
|
||||||
DeleteAction = onConfirm;
|
DangerousAction = onConfirm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Select
|
|||||||
BodyText = $"{score.User} ({score.DisplayAccuracy}, {score.Rank})";
|
BodyText = $"{score.User} ({score.DisplayAccuracy}, {score.Rank})";
|
||||||
|
|
||||||
Icon = FontAwesome.Regular.TrashAlt;
|
Icon = FontAwesome.Regular.TrashAlt;
|
||||||
DeleteAction = () => scoreManager.Delete(score);
|
DangerousAction = () => scoreManager.Delete(score);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Screens.Select
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(SkinManager manager)
|
private void load(SkinManager manager)
|
||||||
{
|
{
|
||||||
DeleteAction = () =>
|
DangerousAction = () =>
|
||||||
{
|
{
|
||||||
manager.Delete(skin.SkinInfo.Value);
|
manager.Delete(skin.SkinInfo.Value);
|
||||||
manager.CurrentSkinInfo.SetDefault();
|
manager.CurrentSkinInfo.SetDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user