mirror of
https://github.com/ppy/osu
synced 2024-12-28 09:52:56 +00:00
Touch up dialogs a bit
This commit is contained in:
parent
f197703fe1
commit
7ace50f442
@ -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;
|
||||
}
|
@ -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;
|
@ -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);
|
||||
}))
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user