mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:47:33 +08:00
pass action instead of storage to TournamentClearAllDialog
This commit is contained in:
parent
3c05246baf
commit
2825671e28
@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Collections;
|
using System;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
|
|
||||||
@ -9,11 +9,11 @@ namespace osu.Game.Tournament.Screens.Editors.Components
|
|||||||
{
|
{
|
||||||
public partial class TournamentClearAllDialog : DangerousActionDialog
|
public partial class TournamentClearAllDialog : DangerousActionDialog
|
||||||
{
|
{
|
||||||
public TournamentClearAllDialog(IList storage)
|
public TournamentClearAllDialog(Action action)
|
||||||
{
|
{
|
||||||
HeaderText = @"Clear all?";
|
HeaderText = @"Clear all?";
|
||||||
Icon = FontAwesome.Solid.Trash;
|
Icon = FontAwesome.Solid.Trash;
|
||||||
DangerousAction = storage.Clear;
|
DangerousAction = action;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
Text = "Clear all",
|
Text = "Clear all",
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
dialogOverlay?.Push(new TournamentClearAllDialog(Storage));
|
dialogOverlay?.Push(new TournamentClearAllDialog(() => Storage.Clear()));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user