From 5048f425d4b5fa37881fea1ae0c648ef441ca8ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Feb 2019 18:36:15 +0900 Subject: [PATCH] Add ability to reset bracket --- .../Screens/Ladder/Components/MatchPairing.cs | 9 +++++++++ osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index b3adc3b49b..7d6acc5bd2 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -110,5 +110,14 @@ public void StartMatch() Team1Score.Value = 0; Team2Score.Value = 0; } + + public void Reset() + { + CancelMatchStart(); + Team1.Value = null; + Team2.Value = null; + Completed.Value = false; + PicksBans.Clear(); + } } } diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs index adc880e524..e3cb1473be 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs @@ -77,6 +77,11 @@ public MenuItem[] ContextMenuItems var pos = PairingsContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); AddPairing(new MatchPairing { Position = { Value = new Point((int)pos.X, (int)pos.Y) } }); }), + new OsuMenuItem("Reset teams", MenuItemType.Destructive, () => + { + foreach (var p in PairingsContainer) + p.Pairing.Reset(); + }) }; } }