diff --git a/osu.Game.Tournament/Screens/Editors/Components/RoundEditorDeleteRoundDialog.cs b/osu.Game.Tournament/Screens/Editors/Components/DeleteRoundDialog.cs similarity index 58% rename from osu.Game.Tournament/Screens/Editors/Components/RoundEditorDeleteRoundDialog.cs rename to osu.Game.Tournament/Screens/Editors/Components/DeleteRoundDialog.cs index 629cd4e135..769412bf94 100644 --- a/osu.Game.Tournament/Screens/Editors/Components/RoundEditorDeleteRoundDialog.cs +++ b/osu.Game.Tournament/Screens/Editors/Components/DeleteRoundDialog.cs @@ -4,14 +4,15 @@ using System; using osu.Framework.Graphics.Sprites; using osu.Game.Overlays.Dialog; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Screens.Editors.Components { - public partial class RoundEditorDeleteRoundDialog : DangerousActionDialog + public partial class DeleteRoundDialog : DangerousActionDialog { - public RoundEditorDeleteRoundDialog(string roundName, Action action) + public DeleteRoundDialog(TournamentRound round, Action action) { - HeaderText = roundName.Length > 0 ? $@"Delete round ""{roundName}""?" : @"Delete unnamed round?"; + HeaderText = round.Name.Value.Length > 0 ? $@"Delete round ""{round.Name.Value}""?" : @"Delete unnamed round?"; Icon = FontAwesome.Solid.Trash; DangerousAction = action; } diff --git a/osu.Game.Tournament/Screens/Editors/Components/TeamEditorDeleteTeamDialog.cs b/osu.Game.Tournament/Screens/Editors/Components/DeleteTeamDialog.cs similarity index 55% rename from osu.Game.Tournament/Screens/Editors/Components/TeamEditorDeleteTeamDialog.cs rename to osu.Game.Tournament/Screens/Editors/Components/DeleteTeamDialog.cs index f91b58e185..65fb47cf94 100644 --- a/osu.Game.Tournament/Screens/Editors/Components/TeamEditorDeleteTeamDialog.cs +++ b/osu.Game.Tournament/Screens/Editors/Components/DeleteTeamDialog.cs @@ -4,15 +4,16 @@ using System; using osu.Framework.Graphics.Sprites; using osu.Game.Overlays.Dialog; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Screens.Editors.Components { - public partial class TeamEditorDeleteTeamDialog : DangerousActionDialog + public partial class DeleteTeamDialog : DangerousActionDialog { - public TeamEditorDeleteTeamDialog(string fullTeamName, string acronym, Action action) + public DeleteTeamDialog(TournamentTeam team, Action action) { - HeaderText = fullTeamName.Length > 0 ? $@"Delete team ""{fullTeamName}""?" : - acronym.Length > 0 ? $@"Delete team ""{acronym}""?" : + HeaderText = team.FullName.Value.Length > 0 ? $@"Delete team ""{team.FullName.Value}""?" : + team.Acronym.Value.Length > 0 ? $@"Delete team ""{team.Acronym.Value}""?" : @"Delete unnamed team?"; Icon = FontAwesome.Solid.Trash; DangerousAction = action; diff --git a/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs index 712a724d4d..6c1e7d9200 100644 --- a/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs @@ -104,13 +104,11 @@ namespace osu.Game.Tournament.Screens.Editors RelativeSizeAxes = Axes.None, Width = 150, Text = "Delete Round", - Action = () => dialogOverlay?.Push( - new RoundEditorDeleteRoundDialog( - Model.Name.Value, () => - { - Expire(); - ladderInfo.Rounds.Remove(Model); - })) + Action = () => dialogOverlay?.Push(new DeleteRoundDialog(Model, () => + { + Expire(); + ladderInfo.Rounds.Remove(Model); + })) } }; diff --git a/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs index aa55c75483..29616292ee 100644 --- a/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs @@ -162,7 +162,7 @@ namespace osu.Game.Tournament.Screens.Editors Text = "Delete Team", Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - Action = () => dialogOverlay?.Push(new TeamEditorDeleteTeamDialog(Model.FullName.Value, Model.Acronym.Value, () => + Action = () => dialogOverlay?.Push(new DeleteTeamDialog(Model, () => { Expire(); ladderInfo.Teams.Remove(Model);