mirror of
https://github.com/ppy/osu
synced 2024-12-28 18:02:53 +00:00
Touch up dialogs a bit
This commit is contained in:
parent
f197703fe1
commit
7ace50f442
@ -4,14 +4,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
|
using osu.Game.Tournament.Models;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Screens.Editors.Components
|
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;
|
Icon = FontAwesome.Solid.Trash;
|
||||||
DangerousAction = action;
|
DangerousAction = action;
|
||||||
}
|
}
|
@ -4,15 +4,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
|
using osu.Game.Tournament.Models;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Screens.Editors.Components
|
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}""?" :
|
HeaderText = team.FullName.Value.Length > 0 ? $@"Delete team ""{team.FullName.Value}""?" :
|
||||||
acronym.Length > 0 ? $@"Delete team ""{acronym}""?" :
|
team.Acronym.Value.Length > 0 ? $@"Delete team ""{team.Acronym.Value}""?" :
|
||||||
@"Delete unnamed team?";
|
@"Delete unnamed team?";
|
||||||
Icon = FontAwesome.Solid.Trash;
|
Icon = FontAwesome.Solid.Trash;
|
||||||
DangerousAction = action;
|
DangerousAction = action;
|
@ -104,13 +104,11 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
Width = 150,
|
Width = 150,
|
||||||
Text = "Delete Round",
|
Text = "Delete Round",
|
||||||
Action = () => dialogOverlay?.Push(
|
Action = () => dialogOverlay?.Push(new DeleteRoundDialog(Model, () =>
|
||||||
new RoundEditorDeleteRoundDialog(
|
{
|
||||||
Model.Name.Value, () =>
|
Expire();
|
||||||
{
|
ladderInfo.Rounds.Remove(Model);
|
||||||
Expire();
|
}))
|
||||||
ladderInfo.Rounds.Remove(Model);
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
Text = "Delete Team",
|
Text = "Delete Team",
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Action = () => dialogOverlay?.Push(new TeamEditorDeleteTeamDialog(Model.FullName.Value, Model.Acronym.Value, () =>
|
Action = () => dialogOverlay?.Push(new DeleteTeamDialog(Model, () =>
|
||||||
{
|
{
|
||||||
Expire();
|
Expire();
|
||||||
ladderInfo.Teams.Remove(Model);
|
ladderInfo.Teams.Remove(Model);
|
||||||
|
Loading…
Reference in New Issue
Block a user