From 76c57a695bec92daa773801203f130f2daf54a2c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Feb 2020 18:28:20 +0900 Subject: [PATCH 1/4] Change create room button colouring to match design --- osu.Game/Screens/Multi/Multiplayer.cs | 45 ++++++++++++++++++--------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 27ad7c9bc1..235ca9ec04 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -19,7 +19,6 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Input; using osu.Game.Online.API; using osu.Game.Online.Multiplayer; -using osu.Game.Overlays.BeatmapSet.Buttons; using osu.Game.Screens.Menu; using osu.Game.Screens.Multi.Components; using osu.Game.Screens.Multi.Lounge; @@ -129,22 +128,11 @@ namespace osu.Game.Screens.Multi } }, new Header(screenStack), - createButton = new HeaderButton + createButton = new CreateRoomButton { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - RelativeSizeAxes = Axes.None, - Size = new Vector2(150, Header.HEIGHT - 20), - Margin = new MarginPadding - { - Top = 10, - Right = 10 + HORIZONTAL_OVERFLOW_PADDING, - }, - Text = "Create room", - Action = () => loungeSubScreen.Open(new Room - { - Name = { Value = $"{api.LocalUser}'s awesome room" } - }), + Action = createRoom }, roomManager = new RoomManager() } @@ -276,6 +264,11 @@ namespace osu.Game.Screens.Multi logo.Delay(WaveContainer.DISAPPEAR_DURATION / 2).FadeOut(); } + private void createRoom() + { + loungeSubScreen.Open(new Room { Name = { Value = $"{api.LocalUser}'s awesome room" } }); + } + private void beginHandlingTrack() { Beatmap.BindValueChanged(updateTrack, true); @@ -381,5 +374,29 @@ namespace osu.Game.Screens.Multi protected override double TransformDuration => 200; } } + + public class CreateRoomButton : TriangleButton + { + public CreateRoomButton() + { + Size = new Vector2(150, Header.HEIGHT - 20); + Margin = new MarginPadding + { + Top = 10, + Right = 10 + HORIZONTAL_OVERFLOW_PADDING, + }; + } + + [BackgroundDependencyLoader] + private void load() + { + BackgroundColour = OsuColour.FromHex(@"593790"); + Triangles.ColourLight = OsuColour.FromHex(@"7247b6"); + Triangles.ColourDark = OsuColour.FromHex(@"593790"); + Triangles.TriangleScale = 1.5f; + + Text = "Create room"; + } + } } } From e7fca689b1ec13bf4ec0d4581badabb992dd598b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Feb 2020 18:34:24 +0900 Subject: [PATCH 2/4] Change text on playlist add button to be nicer --- osu.Game/Screens/Multi/Components/MatchBeatmapDetailArea.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Multi/Components/MatchBeatmapDetailArea.cs b/osu.Game/Screens/Multi/Components/MatchBeatmapDetailArea.cs index 8e085d6979..2c5fd2d397 100644 --- a/osu.Game/Screens/Multi/Components/MatchBeatmapDetailArea.cs +++ b/osu.Game/Screens/Multi/Components/MatchBeatmapDetailArea.cs @@ -53,7 +53,7 @@ namespace osu.Game.Screens.Multi.Components { new TriangleButton { - Text = "create new item", + Text = "Add new playlist entry", RelativeSizeAxes = Axes.Both, Size = Vector2.One, Action = () => CreateNewItem?.Invoke() From a0b578082e459e706ebec315109324b6f1ffffc3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Feb 2020 18:39:10 +0900 Subject: [PATCH 3/4] Make ready button also have triangles --- osu.Game/Screens/Multi/Match/Components/Footer.cs | 1 - osu.Game/Screens/Multi/Match/Components/ReadyButton.cs | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Multi/Match/Components/Footer.cs b/osu.Game/Screens/Multi/Match/Components/Footer.cs index 93430d9131..199563c698 100644 --- a/osu.Game/Screens/Multi/Match/Components/Footer.cs +++ b/osu.Game/Screens/Multi/Match/Components/Footer.cs @@ -47,7 +47,6 @@ namespace osu.Game.Screens.Multi.Match.Components private void load(OsuColour colours) { background.Colour = OsuColour.FromHex(@"28242d"); - startButton.BackgroundColour = colours.Green; } } } diff --git a/osu.Game/Screens/Multi/Match/Components/ReadyButton.cs b/osu.Game/Screens/Multi/Match/Components/ReadyButton.cs index d39217db5d..8f484d3672 100644 --- a/osu.Game/Screens/Multi/Match/Components/ReadyButton.cs +++ b/osu.Game/Screens/Multi/Match/Components/ReadyButton.cs @@ -6,12 +6,13 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Beatmaps; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Online.Multiplayer; namespace osu.Game.Screens.Multi.Match.Components { - public class ReadyButton : OsuButton + public class ReadyButton : TriangleButton { public readonly Bindable SelectedItem = new Bindable(); @@ -32,12 +33,16 @@ namespace osu.Game.Screens.Multi.Match.Components } [BackgroundDependencyLoader] - private void load() + private void load(OsuColour colours) { beatmaps.ItemAdded += beatmapAdded; beatmaps.ItemRemoved += beatmapRemoved; SelectedItem.BindValueChanged(item => updateSelectedItem(item.NewValue), true); + + BackgroundColour = colours.Green; + Triangles.ColourDark = colours.Green; + Triangles.ColourLight = colours.GreenLight; } private void updateSelectedItem(PlaylistItem item) From 4a3f281855784ffaf7bf67f3c1ce5eaa335b8445 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Feb 2020 18:43:47 +0900 Subject: [PATCH 4/4] Make buttons purple --- .../Screens/Multi/Match/Components/Footer.cs | 4 +--- .../Match/Components/MatchSettingsOverlay.cs | 7 ++----- .../Match/Components/PurpleTriangleButton.cs | 20 +++++++++++++++++++ osu.Game/Screens/Multi/Multiplayer.cs | 6 ++---- 4 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 osu.Game/Screens/Multi/Match/Components/PurpleTriangleButton.cs diff --git a/osu.Game/Screens/Multi/Match/Components/Footer.cs b/osu.Game/Screens/Multi/Match/Components/Footer.cs index 199563c698..c0c866d815 100644 --- a/osu.Game/Screens/Multi/Match/Components/Footer.cs +++ b/osu.Game/Screens/Multi/Match/Components/Footer.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; using osu.Game.Online.Multiplayer; using osuTK; @@ -22,7 +21,6 @@ namespace osu.Game.Screens.Multi.Match.Components public readonly Bindable SelectedItem = new Bindable(); private readonly Drawable background; - private readonly OsuButton startButton; public Footer() { @@ -32,7 +30,7 @@ namespace osu.Game.Screens.Multi.Match.Components InternalChildren = new[] { background = new Box { RelativeSizeAxes = Axes.Both }, - startButton = new ReadyButton + new ReadyButton { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game/Screens/Multi/Match/Components/MatchSettingsOverlay.cs b/osu.Game/Screens/Multi/Match/Components/MatchSettingsOverlay.cs index e3110cdfc8..97485cd5a1 100644 --- a/osu.Game/Screens/Multi/Match/Components/MatchSettingsOverlay.cs +++ b/osu.Game/Screens/Multi/Match/Components/MatchSettingsOverlay.cs @@ -226,7 +226,7 @@ namespace osu.Game.Screens.Multi.Match.Components }, new Drawable[] { - new OsuButton + new PurpleTriangleButton { RelativeSizeAxes = Axes.X, Height = 40, @@ -447,10 +447,7 @@ namespace osu.Game.Screens.Multi.Match.Components Menu.MaxHeight = 100; } - protected override string GenerateItemText(TimeSpan item) - { - return item.Humanize(); - } + protected override string GenerateItemText(TimeSpan item) => item.Humanize(); } } } diff --git a/osu.Game/Screens/Multi/Match/Components/PurpleTriangleButton.cs b/osu.Game/Screens/Multi/Match/Components/PurpleTriangleButton.cs new file mode 100644 index 0000000000..8a0369ceba --- /dev/null +++ b/osu.Game/Screens/Multi/Match/Components/PurpleTriangleButton.cs @@ -0,0 +1,20 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Screens.Multi.Match.Components +{ + public class PurpleTriangleButton : TriangleButton + { + [BackgroundDependencyLoader] + private void load() + { + BackgroundColour = OsuColour.FromHex(@"593790"); + Triangles.ColourLight = OsuColour.FromHex(@"7247b6"); + Triangles.ColourDark = OsuColour.FromHex(@"593790"); + } + } +} diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 235ca9ec04..1219919425 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -24,6 +24,7 @@ using osu.Game.Screens.Multi.Components; using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.Multi.Match; +using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.Play; using osuTK; @@ -375,7 +376,7 @@ namespace osu.Game.Screens.Multi } } - public class CreateRoomButton : TriangleButton + public class CreateRoomButton : PurpleTriangleButton { public CreateRoomButton() { @@ -390,9 +391,6 @@ namespace osu.Game.Screens.Multi [BackgroundDependencyLoader] private void load() { - BackgroundColour = OsuColour.FromHex(@"593790"); - Triangles.ColourLight = OsuColour.FromHex(@"7247b6"); - Triangles.ColourDark = OsuColour.FromHex(@"593790"); Triangles.TriangleScale = 1.5f; Text = "Create room";