From 3caffb81e187e2d546fba85640791004d12e3ad5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Mar 2020 16:03:18 +0900 Subject: [PATCH 1/6] Add new element colours to TournamentGame --- osu.Game.Tournament/TournamentGame.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index 608fc5f04a..6d597d5e7d 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -2,15 +2,25 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Game.Graphics; using osu.Game.Graphics.Cursor; +using osu.Game.Tournament.Models; using osuTK.Graphics; namespace osu.Game.Tournament { public class TournamentGame : TournamentGameBase { - public static readonly Color4 COLOUR_RED = new Color4(144, 0, 0, 255); - public static readonly Color4 COLOUR_BLUE = new Color4(0, 84, 144, 255); + public static ColourInfo GetTeamColour(TeamColour teamColour) => teamColour == TeamColour.Red ? COLOUR_RED : COLOUR_BLUE; + + public static readonly Color4 COLOUR_RED = OsuColour.FromHex("#AA1414"); + public static readonly Color4 COLOUR_BLUE = OsuColour.FromHex("#1462AA"); + + public static readonly Color4 ELEMENT_BACKGROUND_COLOUR = OsuColour.FromHex("#fff"); + public static readonly Color4 ELEMENT_FOREGROUND_COLOUR = OsuColour.FromHex("#000"); + + public static readonly Color4 TEXT_COLOUR = OsuColour.FromHex("#fff"); protected override void LoadComplete() { From 129c8fe24ff86054d5875650d47acf5da098307d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Mar 2020 16:03:34 +0900 Subject: [PATCH 2/6] Add helper method to get winning team colour --- osu.Game.Tournament/Models/TournamentMatch.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Tournament/Models/TournamentMatch.cs b/osu.Game.Tournament/Models/TournamentMatch.cs index 06cce3d59e..8ebcbf4e15 100644 --- a/osu.Game.Tournament/Models/TournamentMatch.cs +++ b/osu.Game.Tournament/Models/TournamentMatch.cs @@ -90,6 +90,8 @@ namespace osu.Game.Tournament.Models [JsonIgnore] public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value; + public TeamColour WinnerColour => Winner == Team1.Value ? TeamColour.Red : TeamColour.Blue; + public int PointsToWin => Round.Value?.BestOf.Value / 2 + 1 ?? 0; /// From aeb6bf5b4619e139526600b5f2fd78ca5f72bfd4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Mar 2020 16:36:07 +0900 Subject: [PATCH 3/6] Remove unnecessary width specification on editor screens --- osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs index e4256e727d..8e5df72cc8 100644 --- a/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs @@ -40,7 +40,6 @@ namespace osu.Game.Tournament.Screens.Editors new OsuScrollContainer { RelativeSizeAxes = Axes.Both, - Width = 0.9f, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Child = flow = new FillFlowContainer From 01e32896eebdbdaf880610b888993ce9f061e81e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Mar 2020 17:43:47 +0900 Subject: [PATCH 4/6] Make save changes button more prominent --- osu.Game.Tournament/TournamentGameBase.cs | 37 +++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 435f315c8d..41165ca141 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -22,6 +22,7 @@ using osu.Game.Online.API.Requests; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Models; using osu.Game.Users; +using osuTK; using osuTK.Graphics; using osuTK.Input; @@ -74,16 +75,40 @@ namespace osu.Game.Tournament AddRange(new[] { - new TourneyButton + new Container { - Text = "Save Changes", - Width = 140, - Height = 50, + CornerRadius = 10, Depth = float.MinValue, + Position = new Vector2(5), + Masking = true, + AutoSizeAxes = Axes.Both, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, - Padding = new MarginPadding(10), - Action = SaveChanges, + Children = new Drawable[] + { + new Box + { + Colour = OsuColour.Gray(0.2f), + RelativeSizeAxes = Axes.Both, + }, + new TourneyButton + { + Text = "Save Changes", + Width = 140, + Height = 50, + Padding = new MarginPadding + { + Top = 10, + Left = 10, + }, + Margin = new MarginPadding + { + Right = 10, + Bottom = 10, + }, + Action = SaveChanges, + }, + } }, heightWarning = new Container { From aed52179f0ffaea6be4e15775857370201ee5fd9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 7 Mar 2020 16:29:11 +0900 Subject: [PATCH 5/6] Fix weird reverse logic --- osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs | 6 +++--- osu.Game/Online/Chat/StandAloneChatDisplay.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index d632e7c5f3..6ba57c60b8 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -162,7 +162,7 @@ namespace osu.Game.Tournament.Screens.Gameplay void expand() { - chat?.Expand(); + chat?.Contract(); using (BeginDelayedSequence(300, true)) { @@ -176,7 +176,7 @@ namespace osu.Game.Tournament.Screens.Gameplay SongBar.Expanded = false; scoreDisplay.FadeOut(100); using (chat?.BeginDelayedSequence(500)) - chat?.Contract(); + chat?.Expand(); } switch (state.NewValue) @@ -203,7 +203,7 @@ namespace osu.Game.Tournament.Screens.Gameplay break; default: - chat.Expand(); + chat.Contract(); expand(); break; } diff --git a/osu.Game/Online/Chat/StandAloneChatDisplay.cs b/osu.Game/Online/Chat/StandAloneChatDisplay.cs index 21d0bcc4bf..881dd19d8e 100644 --- a/osu.Game/Online/Chat/StandAloneChatDisplay.cs +++ b/osu.Game/Online/Chat/StandAloneChatDisplay.cs @@ -92,13 +92,13 @@ namespace osu.Game.Online.Chat textbox.Text = string.Empty; } - public void Contract() + public void Expand() { this.FadeIn(300); this.MoveToY(0, 500, Easing.OutQuint); } - public void Expand() + public void Contract() { this.FadeOut(200); this.MoveToY(100, 500, Easing.In); From 0102aaf32a53e6c2a0714ca79a85ca7b24fe949d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 8 Mar 2020 18:11:57 +0900 Subject: [PATCH 6/6] Move chat expand/contract logic local to tournament --- .../Components/TournamentMatchChatDisplay.cs | 4 ++++ osu.Game/Online/Chat/StandAloneChatDisplay.cs | 12 ------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs b/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs index 48c5b9bd35..f9cd18be2c 100644 --- a/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs @@ -66,6 +66,10 @@ namespace osu.Game.Tournament.Components } } + public void Expand() => this.FadeIn(300); + + public void Contract() => this.FadeOut(200); + protected override ChatLine CreateMessage(Message message) => new MatchMessage(message); protected class MatchMessage : StandAloneMessage diff --git a/osu.Game/Online/Chat/StandAloneChatDisplay.cs b/osu.Game/Online/Chat/StandAloneChatDisplay.cs index 881dd19d8e..0914f688e9 100644 --- a/osu.Game/Online/Chat/StandAloneChatDisplay.cs +++ b/osu.Game/Online/Chat/StandAloneChatDisplay.cs @@ -92,18 +92,6 @@ namespace osu.Game.Online.Chat textbox.Text = string.Empty; } - public void Expand() - { - this.FadeIn(300); - this.MoveToY(0, 500, Easing.OutQuint); - } - - public void Contract() - { - this.FadeOut(200); - this.MoveToY(100, 500, Easing.In); - } - protected virtual ChatLine CreateMessage(Message message) => new StandAloneMessage(message); private void channelChanged(ValueChangedEvent e)