Touch up dialogs a bit

This commit is contained in:
Bartłomiej Dach 2023-07-21 21:17:14 +02:00
parent f197703fe1
commit 7ace50f442
No known key found for this signature in database
4 changed files with 15 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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