From 4d74493289a7de37137727545b67629ca3576343 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Mar 2020 16:08:05 +0900 Subject: [PATCH 1/3] Initial pass of win screen design update --- .../Screens/TeamWin/TeamWinScreen.cs | 110 ++++-------------- 1 file changed, 23 insertions(+), 87 deletions(-) diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index 1765ab7ba2..8b3f4488d0 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -10,7 +10,6 @@ using osu.Game.Graphics; using osu.Game.Tournament.Components; using osu.Game.Tournament.Models; using osuTK; -using osuTK.Graphics; namespace osu.Game.Tournament.Screens.TeamWin { @@ -73,105 +72,42 @@ namespace osu.Game.Tournament.Screens.TeamWin return; } - bool redWin = match.Winner == match.Team1.Value; - redWinVideo.Alpha = redWin ? 1 : 0; - blueWinVideo.Alpha = redWin ? 0 : 1; + redWinVideo.Alpha = match.WinnerColour == TeamColour.Red ? 1 : 0; + blueWinVideo.Alpha = match.WinnerColour == TeamColour.Blue ? 1 : 0; mainContainer.Children = new Drawable[] { - new TeamFlagDisplay(match.Winner) + new DrawableTeamFlag(match.Winner) { Size = new Vector2(300, 200), Scale = new Vector2(0.5f), Anchor = Anchor.Centre, Origin = Anchor.Centre, - X = -387, + Position = new Vector2(-300, 10), }, - new TournamentSpriteText + new FillFlowContainer { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, Anchor = Anchor.Centre, - Origin = Anchor.TopLeft, - Position = new Vector2(78, -70), - Colour = OsuColour.Gray(0.33f), - Text = match.Round.Value?.Name.Value ?? "Unknown Round", - Font = OsuFont.Torus.With(size: 30, weight: FontWeight.Regular) - }, - new TeamWithPlayers(match.Winner, redWin) - { - RelativeSizeAxes = Axes.Both, - Width = 0.5f, - Height = 0.6f, - Anchor = Anchor.Centre, - Origin = Anchor.TopLeft, - Position = new Vector2(78, 0), + Origin = Anchor.Centre, + X = 260, + Children = new Drawable[] + { + new RoundDisplay(match) + { + Margin = new MarginPadding { Bottom = 30 }, + }, + new TournamentSpriteText + { + Text = "WINNER", + Font = OsuFont.Torus.With(size: 100, weight: FontWeight.Bold), + Margin = new MarginPadding { Bottom = 50 }, + }, + new DrawableTeamWithPlayers(match.Winner, match.WinnerColour) + } }, }; } - - private class TeamWithPlayers : CompositeDrawable - { - public TeamWithPlayers(TournamentTeam team, bool left = false) - { - FillFlowContainer players; - - var colour = left ? TournamentGame.COLOUR_RED : TournamentGame.COLOUR_BLUE; - InternalChildren = new Drawable[] - { - new FillFlowContainer - { - Direction = FillDirection.Vertical, - AutoSizeAxes = Axes.Both, - Children = new Drawable[] - { - new TournamentSpriteText - { - Text = "WINNER", - Font = OsuFont.Torus.With(size: 24, weight: FontWeight.SemiBold), - Colour = Color4.Black, - }, - new TournamentSpriteText - { - Text = team?.FullName.Value ?? "???", - Font = OsuFont.Torus.With(size: 30, weight: FontWeight.SemiBold), - Colour = Color4.Black, - }, - players = new FillFlowContainer - { - Direction = FillDirection.Vertical, - AutoSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = 10 }, - }, - } - }, - }; - - if (team != null) - { - foreach (var p in team.Players) - { - players.Add(new TournamentSpriteText - { - Text = p.Username, - Font = OsuFont.Torus.With(size: 24), - Colour = colour, - Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, - Origin = left ? Anchor.CentreRight : Anchor.CentreLeft, - }); - } - } - } - } - - private class TeamFlagDisplay : DrawableTournamentTeam - { - public TeamFlagDisplay(TournamentTeam team) - : base(team) - { - InternalChildren = new Drawable[] - { - Flag - }; - } - } } } From a85cef2f064640f6a5d7029b65aded95e9ed353b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 8 Mar 2020 14:23:13 +0900 Subject: [PATCH 2/3] Reset win screen video on display; add fade in transition --- osu.Game.Tournament/Components/TourneyVideo.cs | 2 ++ .../Screens/TeamWin/TeamWinScreen.cs | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Components/TourneyVideo.cs b/osu.Game.Tournament/Components/TourneyVideo.cs index 7d2eaff515..9b1350ca23 100644 --- a/osu.Game.Tournament/Components/TourneyVideo.cs +++ b/osu.Game.Tournament/Components/TourneyVideo.cs @@ -60,6 +60,8 @@ namespace osu.Game.Tournament.Components } } + public void Reset() => manualClock.CurrentTime = 0; + protected override void Update() { base.Update(); diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index 8b3f4488d0..3870f486e1 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -62,7 +62,9 @@ namespace osu.Game.Tournament.Screens.TeamWin update(); } - private void update() + private bool firstDisplay = true; + + private void update() => Schedule(() => { var match = currentMatch.Value; @@ -75,6 +77,15 @@ namespace osu.Game.Tournament.Screens.TeamWin redWinVideo.Alpha = match.WinnerColour == TeamColour.Red ? 1 : 0; blueWinVideo.Alpha = match.WinnerColour == TeamColour.Blue ? 1 : 0; + if (firstDisplay) + { + if (match.WinnerColour == TeamColour.Red) + redWinVideo.Reset(); + else + blueWinVideo.Reset(); + firstDisplay = false; + } + mainContainer.Children = new Drawable[] { new DrawableTeamFlag(match.Winner) @@ -108,6 +119,8 @@ namespace osu.Game.Tournament.Screens.TeamWin } }, }; - } + mainContainer.FadeOut(); + mainContainer.Delay(2000).FadeIn(1600, Easing.OutQuint); + }); } } From 6421f28ac70964d3438aae62cf0df9888c4ea4f0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 9 Mar 2020 19:07:44 +0900 Subject: [PATCH 3/3] Fix nullref --- osu.Game.Tournament/Components/TourneyVideo.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Components/TourneyVideo.cs b/osu.Game.Tournament/Components/TourneyVideo.cs index 687acaa6d5..43088d6b92 100644 --- a/osu.Game.Tournament/Components/TourneyVideo.cs +++ b/osu.Game.Tournament/Components/TourneyVideo.cs @@ -64,7 +64,11 @@ namespace osu.Game.Tournament.Components } } - public void Reset() => manualClock.CurrentTime = 0; + public void Reset() + { + if (manualClock != null) + manualClock.CurrentTime = 0; + } protected override void Update() {