From fdccec06b3c8809a4a2bf30a40a6327834cb6e6e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 03:55:24 +0900 Subject: [PATCH] Change colour for losers pairings --- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 5 +++-- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 42670b7bc0..ee69f5c079 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -65,6 +65,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.Completed.BindValueChanged(_ => updateProgression()); pairing.Progression.BindValueChanged(_ => updateProgression()); pairing.LosersProgression.BindValueChanged(_ => updateProgression()); + pairing.Losers.BindValueChanged(_ => updateTeams()); updateTeams(); } @@ -156,8 +157,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components flow.Children = new[] { - new DrawableMatchTeam(Pairing.Team1, Pairing), - new DrawableMatchTeam(Pairing.Team2, Pairing) + new DrawableMatchTeam(Pairing.Team1, Pairing, Pairing.Losers), + new DrawableMatchTeam(Pairing.Team2, Pairing, Pairing.Losers) }; SchedulerAfterChildren.Add(() => Scheduler.Add(updateProgression)); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index f346e3c242..7e3d5f4f2b 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -2,8 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Collections.Generic; -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -26,6 +24,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public class DrawableMatchTeam : DrawableTournamentTeam, IHasContextMenu { private readonly MatchPairing pairing; + private readonly bool losers; private OsuSpriteText scoreText; private Box background; @@ -41,10 +40,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [Resolved(CanBeNull = true)] private LadderEditorInfo editorInfo { get; set; } = null; - public DrawableMatchTeam(Bindable team, MatchPairing pairing) + public DrawableMatchTeam(Bindable team, MatchPairing pairing, bool losers) : base(team) { this.pairing = pairing; + this.losers = losers; Size = new Vector2(150, 40); Masking = true; @@ -72,7 +72,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { this.manager = manager; - colourWinner = colours.BlueDarker; + colourWinner = losers ? colours.YellowDarker : colours.BlueDarker; colourNormal = OsuColour.Gray(0.2f); InternalChildren = new Drawable[]