diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 30a151f09a9a..337db4a41655 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -30,8 +30,6 @@ public partial class DrawableMatchTeam : DrawableTournamentTeam, IHasContextMenu private Box background = null!; private Box backgroundRight = null!; - private readonly bool wider; - private readonly Bindable score = new Bindable(); private readonly BindableBool completed = new BindableBool(); @@ -58,16 +56,12 @@ private void setCurrent() [Resolved] private LadderEditorInfo? editorInfo { get; set; } - public DrawableMatchTeam(TournamentTeam? team, TournamentMatch match, bool losers, bool wider = false) + public DrawableMatchTeam(TournamentTeam? team, TournamentMatch match, bool losers, float targetWidth = 150) : base(team) { this.match = match; this.losers = losers; - this.wider = wider; - Size = new Vector2(150, 40); - - if (wider) - Width = 300; + Size = new Vector2(targetWidth, 40); AcronymText.Anchor = AcronymText.Origin = Anchor.CentreLeft; AcronymText.Padding = new MarginPadding { Left = 10 }; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs index 6296ef99baa7..e3e196742486 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs @@ -28,7 +28,20 @@ public partial class DrawableTournamentMatch : CompositeDrawable private readonly Drawable currentMatchSelectionBox; private Bindable? globalSelection; - public bool IsVertical; + private float targetMatchWidth = 150; + + public float TargetMatchWidth + { + get => targetMatchWidth; + set + { + if (targetMatchWidth == value) + return; + + targetMatchWidth = value; + updateTeams(); + } + } [Resolved] private LadderEditorInfo? editorInfo { get; set; } @@ -281,8 +294,8 @@ private void updateTeams() Flow.Children = new[] { - new DrawableMatchTeam(Match.Team1.Value, Match, Match.Losers.Value, IsVertical), - new DrawableMatchTeam(Match.Team2.Value, Match, Match.Losers.Value, IsVertical) + new DrawableMatchTeam(Match.Team1.Value, Match, Match.Losers.Value, TargetMatchWidth), + new DrawableMatchTeam(Match.Team2.Value, Match, Match.Losers.Value, TargetMatchWidth) }; SchedulerAfterChildren.Add(() => Scheduler.Add(updateProgression)); diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 7d8b5eb7e46f..188f7c79c54e 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -246,9 +246,15 @@ public partial class ScheduleMatch : DrawableTournamentMatch public ScheduleMatch(TournamentMatch match, bool showTimestamp = true, bool isVertical = false) : base(match) { - IsVertical = isVertical; + TargetMatchWidth = 240; + Scale = new Vector2(0.8f); + if (!isVertical) + { + Flow.Direction = FillDirection.Horizontal; + } + bool conditional = match is ConditionalTournamentMatch; if (conditional) @@ -276,21 +282,6 @@ public ScheduleMatch(TournamentMatch match, bool showTimestamp = true, bool isVe }); } } - - protected override void LoadComplete() - { - base.LoadComplete(); - - if (IsVertical) - { - AutoSizeAxes = Axes.Y; - Width = 302; - } - else - { - Flow.Direction = FillDirection.Horizontal; - } - } } public partial class ScheduleMatchDate : DrawableDate