refactor LadderResetTeamsDialog.cs

This commit is contained in:
Dao Heng Liu 2023-07-16 22:44:41 +01:00
parent 2833497e5b
commit e7795296e2
3 changed files with 4 additions and 18 deletions

View File

@ -14,7 +14,6 @@
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 @@ public MenuItem[] ContextMenuItems
}),
new OsuMenuItem("Reset teams", MenuItemType.Destructive, () =>
{
dialogOverlay?.Push(new BracketResetTeamsDialog(MatchesContainer));
dialogOverlay?.Push(new LadderResetTeamsDialog(MatchesContainer));
})
};
}

View File

@ -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)

View File

@ -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;