mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:12:54 +08:00
refactor LadderResetTeamsDialog.cs
This commit is contained in:
parent
2833497e5b
commit
e7795296e2
@ -14,7 +14,6 @@ using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Input.States;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Tournament.Components;
|
||||
using osu.Game.Overlays;
|
||||
@ -80,7 +79,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
}),
|
||||
new OsuMenuItem("Reset teams", MenuItemType.Destructive, () =>
|
||||
{
|
||||
dialogOverlay?.Push(new BracketResetTeamsDialog(MatchesContainer));
|
||||
dialogOverlay?.Push(new LadderResetTeamsDialog(MatchesContainer));
|
||||
})
|
||||
};
|
||||
}
|
||||
|
@ -1,29 +1,18 @@
|
||||
// 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.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Overlays.Dialog;
|
||||
using osu.Game.Tournament.Screens.Ladder.Components;
|
||||
|
||||
namespace osu.Game.Tournament.Screens
|
||||
namespace osu.Game.Tournament.Screens.Ladder.Components
|
||||
{
|
||||
public partial class BracketResetTeamsDialog : DangerousActionDialog
|
||||
public partial class LadderResetTeamsDialog : DangerousActionDialog
|
||||
{
|
||||
private readonly Container<DrawableTournamentMatch> matchesContainer;
|
||||
|
||||
public BracketResetTeamsDialog(Container<DrawableTournamentMatch> matchesContainer)
|
||||
public LadderResetTeamsDialog(Container<DrawableTournamentMatch> matchesContainer)
|
||||
{
|
||||
this.matchesContainer = matchesContainer;
|
||||
BodyText = @"";
|
||||
HeaderText = @"Confirm reset teams?";
|
||||
Icon = FontAwesome.Solid.Undo;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
DangerousAction = () =>
|
||||
{
|
||||
foreach (var p in matchesContainer)
|
@ -6,14 +6,12 @@
|
||||
using System.Collections.Specialized;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Caching;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Lines;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Tournament.Components;
|
||||
using osu.Game.Tournament.Models;
|
||||
using osu.Game.Tournament.Screens.Editors;
|
||||
|
Loading…
Reference in New Issue
Block a user