From f1dd319fd99393c2a9ae2a6741f5621c6d47c77d Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Fri, 15 Apr 2022 15:38:47 +0100 Subject: [PATCH 01/14] Implement `ChannelList` for new chat design Reference design: https://www.figma.com/file/f8b2dHp9LJCMOqYP4mdrPZ/Client%2FChat?node-id=1%3A297 Adds new component `ChannelList` which makes up the sidebar channel selector of the new chat design. Contains two separate fill flows for public and private `ChannelItem` child components. Exposed bindable `SelectorActive` to indicate current state of the "Add more channels" button. Requires `Bindable` from parent component. Renames and updates the `TestSceneChannelListItem` to `TestSceneChannelList` to make use of new component and having both tests seemed redundant. --- .../Visual/Online/TestSceneChannelList.cs | 187 ++++++++++++++++++ .../Visual/Online/TestSceneChannelListItem.cs | 163 --------------- .../Overlays/Chat/ChannelList/ChannelList.cs | 174 ++++++++++++++++ .../Chat/ChannelList/ChannelListSelector.cs | 84 ++++++++ 4 files changed, 445 insertions(+), 163 deletions(-) create mode 100644 osu.Game.Tests/Visual/Online/TestSceneChannelList.cs delete mode 100644 osu.Game.Tests/Visual/Online/TestSceneChannelListItem.cs create mode 100644 osu.Game/Overlays/Chat/ChannelList/ChannelList.cs create mode 100644 osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs diff --git a/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs b/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs new file mode 100644 index 0000000000..d6a1e71f0d --- /dev/null +++ b/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs @@ -0,0 +1,187 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Testing; +using osu.Framework.Utils; +using osu.Game.Graphics.Sprites; +using osu.Game.Online.API.Requests.Responses; +using osu.Game.Online.Chat; +using osu.Game.Overlays; +using osu.Game.Overlays.Chat.ChannelList; + +namespace osu.Game.Tests.Visual.Online +{ + [TestFixture] + public class TestSceneChannelList : OsuTestScene + { + [Cached] + private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink); + + [Cached] + private readonly Bindable selected = new Bindable(); + + private OsuSpriteText selectorText; + private OsuSpriteText selectedText; + private OsuSpriteText leaveText; + private ChannelList channelList; + + [SetUp] + public void SetUp() + { + Schedule(() => + { + Child = new GridContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Height = 0.7f, + RowDimensions = new[] + { + new Dimension(GridSizeMode.Absolute, 20), + new Dimension(GridSizeMode.Absolute, 20), + new Dimension(GridSizeMode.Absolute, 20), + new Dimension(), + }, + Content = new[] + { + new Drawable[] + { + selectorText = new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }, + }, + new Drawable[] + { + selectedText = new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }, + }, + new Drawable[] + { + leaveText = new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }, + }, + new Drawable[] + { + channelList = new ChannelList + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Y, + Width = 190, + }, + }, + }, + }; + + channelList.OnRequestSelect += channel => + { + channelList.SelectorActive.Value = false; + selected.Value = channel; + }; + + channelList.OnRequestLeave += channel => + { + leaveText.Text = $"OnRequestLeave: {channel.Name}"; + leaveText.FadeOutFromOne(1000, Easing.InQuint); + selected.Value = null; + channelList.RemoveChannel(channel); + }; + + channelList.SelectorActive.BindValueChanged(change => + { + selectorText.Text = $"Channel Selector Active: {change.NewValue}"; + }, true); + + selected.BindValueChanged(change => + { + selectedText.Text = $"Selected Channel: {change.NewValue?.Name ?? "[null]"}"; + }, true); + }); + } + + [SetUpSteps] + public void SetUpSteps() + { + AddStep("Add Public Channels", () => + { + for (int i = 0; i < 10; i++) + channelList.AddChannel(createRandomPublicChannel()); + }); + + AddStep("Add Private Channels", () => + { + for (int i = 0; i < 10; i++) + channelList.AddChannel(createRandomPrivateChannel()); + }); + } + + [Test] + public void TestVisual() + { + AddStep("Unread Selected", () => + { + if (selected.Value != null) + channelList.GetItem(selected.Value).Unread.Value = true; + }); + + AddStep("Read Selected", () => + { + if (selected.Value != null) + channelList.GetItem(selected.Value).Unread.Value = false; + }); + + AddStep("Add Mention Selected", () => + { + if (selected.Value != null) + channelList.GetItem(selected.Value).Mentions.Value++; + }); + + AddStep("Add 98 Mentions Selected", () => + { + if (selected.Value != null) + channelList.GetItem(selected.Value).Mentions.Value += 98; + }); + + AddStep("Clear Mentions Selected", () => + { + if (selected.Value != null) + channelList.GetItem(selected.Value).Mentions.Value = 0; + }); + } + + private Channel createRandomPublicChannel() + { + int id = RNG.Next(0, 10000); + return new Channel + { + Name = $"#channel-{id}", + Type = ChannelType.Public, + Id = id, + }; + } + + private Channel createRandomPrivateChannel() + { + int id = RNG.Next(0, 10000); + return new Channel(new APIUser + { + Id = id, + Username = $"test user {id}", + }); + } + } +} diff --git a/osu.Game.Tests/Visual/Online/TestSceneChannelListItem.cs b/osu.Game.Tests/Visual/Online/TestSceneChannelListItem.cs deleted file mode 100644 index af419c8b91..0000000000 --- a/osu.Game.Tests/Visual/Online/TestSceneChannelListItem.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using NUnit.Framework; -using System.Collections.Generic; -using System.Linq; -using osu.Framework.Allocation; -using osu.Framework.Bindables; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics.Sprites; -using osu.Game.Online.API.Requests.Responses; -using osu.Game.Online.Chat; -using osu.Game.Overlays; -using osu.Game.Overlays.Chat.ChannelList; -using osuTK; - -namespace osu.Game.Tests.Visual.Online -{ - [TestFixture] - public class TestSceneChannelListItem : OsuTestScene - { - [Cached] - private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink); - - [Cached] - private readonly Bindable selected = new Bindable(); - - private static readonly List channels = new List - { - createPublicChannel("#public-channel"), - createPublicChannel("#public-channel-long-name"), - createPrivateChannel("test user", 2), - createPrivateChannel("test user long name", 3), - }; - - private readonly Dictionary channelMap = new Dictionary(); - - private FillFlowContainer flow; - private OsuSpriteText selectedText; - private OsuSpriteText leaveText; - - [SetUp] - public void SetUp() - { - Schedule(() => - { - foreach (var item in channelMap.Values) - item.Expire(); - - channelMap.Clear(); - - Child = new FillFlowContainer - { - Direction = FillDirection.Vertical, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - AutoSizeAxes = Axes.Both, - Spacing = new Vector2(10), - Children = new Drawable[] - { - selectedText = new OsuSpriteText - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - }, - leaveText = new OsuSpriteText - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Height = 16, - AlwaysPresent = true, - }, - new Container - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - AutoSizeAxes = Axes.Y, - Width = 190, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = colourProvider.Background6, - }, - flow = new FillFlowContainer - { - Direction = FillDirection.Vertical, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - }, - }, - }, - }, - }; - - selected.BindValueChanged(change => - { - selectedText.Text = $"Selected Channel: {change.NewValue?.Name ?? "[null]"}"; - }, true); - - foreach (var channel in channels) - { - var item = new ChannelListItem(channel); - flow.Add(item); - channelMap.Add(channel, item); - item.OnRequestSelect += c => selected.Value = c; - item.OnRequestLeave += leaveChannel; - } - }); - } - - [Test] - public void TestVisual() - { - AddStep("Select second item", () => selected.Value = channels.Skip(1).First()); - - AddStep("Unread Selected", () => - { - if (selected.Value != null) - channelMap[selected.Value].Unread.Value = true; - }); - - AddStep("Read Selected", () => - { - if (selected.Value != null) - channelMap[selected.Value].Unread.Value = false; - }); - - AddStep("Add Mention Selected", () => - { - if (selected.Value != null) - channelMap[selected.Value].Mentions.Value++; - }); - - AddStep("Add 98 Mentions Selected", () => - { - if (selected.Value != null) - channelMap[selected.Value].Mentions.Value += 98; - }); - - AddStep("Clear Mentions Selected", () => - { - if (selected.Value != null) - channelMap[selected.Value].Mentions.Value = 0; - }); - } - - private void leaveChannel(Channel channel) - { - leaveText.Text = $"OnRequestLeave: {channel.Name}"; - leaveText.FadeOutFromOne(1000, Easing.InQuint); - } - - private static Channel createPublicChannel(string name) => - new Channel { Name = name, Type = ChannelType.Public, Id = 1234 }; - - private static Channel createPrivateChannel(string username, int id) - => new Channel(new APIUser { Id = id, Username = username }); - } -} diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs new file mode 100644 index 0000000000..4ffb6be451 --- /dev/null +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -0,0 +1,174 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +#nullable enable + +using System; +using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.Events; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Online.Chat; +using osuTK; + +namespace osu.Game.Overlays.Chat.ChannelList +{ + public class ChannelList : Container + { + public Action? OnRequestSelect; + public Action? OnRequestLeave; + + public readonly BindableBool SelectorActive = new BindableBool(); + + private readonly Dictionary channelMap = new Dictionary(); + + private ChannelListItemFlow publicChannelFlow = null!; + private ChannelListItemFlow privateChannelFlow = null!; + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = colourProvider.Background6, + }, + new ChannelListScrollContainer + { + Padding = new MarginPadding { Vertical = 7 }, + RelativeSizeAxes = Axes.Both, + ScrollbarAnchor = Anchor.TopLeft, + ScrollDistance = 35f, + Child = new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + publicChannelFlow = new ChannelListItemFlow("CHANNELS"), + new ChannelListSelector + { + Margin = new MarginPadding { Bottom = 10 }, + SelectorActive = { BindTarget = SelectorActive }, + }, + privateChannelFlow = new ChannelListItemFlow("DIRECT MESSAGES"), + }, + }, + }, + }; + } + + public void AddChannel(Channel channel) + { + if (channelMap.ContainsKey(channel)) + return; + + ChannelListItem item = new ChannelListItem(channel); + item.OnRequestSelect += channel => this.OnRequestSelect?.Invoke(channel); + item.OnRequestLeave += channel => this.OnRequestLeave?.Invoke(channel); + + ChannelListItemFlow flow = getFlowForChannel(channel); + channelMap.Add(channel, item); + flow.Add(item); + } + + public void RemoveChannel(Channel channel) + { + if (!channelMap.ContainsKey(channel)) + return; + + ChannelListItem item = channelMap[channel]; + ChannelListItemFlow flow = getFlowForChannel(channel); + + channelMap.Remove(channel); + flow.Remove(item); + item.Expire(); + } + + public ChannelListItem GetItem(Channel channel) + { + if (!channelMap.ContainsKey(channel)) + throw new ArgumentOutOfRangeException(); + + return channelMap[channel]; + } + + private ChannelListItemFlow getFlowForChannel(Channel channel) + { + switch (channel.Type) + { + case ChannelType.Public: + return publicChannelFlow; + + case ChannelType.PM: + return privateChannelFlow; + + default: + throw new ArgumentOutOfRangeException(); + } + } + + private class ChannelListItemFlow : FillFlowContainer + { + public ChannelListItemFlow(string label) + { + Direction = FillDirection.Vertical; + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + + Add(new OsuSpriteText + { + Text = label, + Margin = new MarginPadding { Left = 18, Bottom = 5 }, + Font = OsuFont.Torus.With(size: 12), + }); + } + } + + private class ChannelListScrollContainer : OsuScrollContainer + { + protected override bool OnHover(HoverEvent e) + { + ScrollbarVisible = true; + return base.OnHover(e); + } + + protected override void OnHoverLost(HoverLostEvent e) + { + ScrollbarVisible = false; + base.OnHoverLost(e); + } + + protected override ScrollbarContainer CreateScrollbar(Direction direction) + => new ChannelListScrollBar(direction); + + protected class ChannelListScrollBar : OsuScrollbar + { + private const float BAR_SIZE = 4; + private const float BAR_MARGIN = 7; + + public ChannelListScrollBar(Direction scrollDir) : base(scrollDir) + { + Size = new Vector2(BAR_SIZE); + Margin = new MarginPadding { Left = BAR_MARGIN }; + CornerRadius = 2; + } + + public override void ResizeTo(float val, int duration = 0, Easing easing = Easing.None) + { + Vector2 size = new Vector2(BAR_SIZE, val); + this.ResizeTo(size, duration, easing); + } + } + } + } +} diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs new file mode 100644 index 0000000000..5bc9a01598 --- /dev/null +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs @@ -0,0 +1,84 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +#nullable enable + +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.Events; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Overlays.Chat.ChannelList +{ + public class ChannelListSelector : OsuClickableContainer + { + public readonly BindableBool SelectorActive = new BindableBool(); + + private Box hoverBox = null!; + private Box selectBox = null!; + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + Height = 30; + RelativeSizeAxes = Axes.X; + + Children = new Drawable[] + { + hoverBox = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = colourProvider.Background3, + Alpha = 0f, + }, + selectBox = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = colourProvider.Background4, + Alpha = 0f, + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Left = 18, Right = 10 }, + Child = new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Text = "Add More Channels", + Font = OsuFont.Torus.With(size: 17, weight: FontWeight.SemiBold), + Colour = colourProvider.Light3, + Margin = new MarginPadding { Bottom = 2 }, + RelativeSizeAxes = Axes.X, + Truncate = true, + }, + }, + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + SelectorActive.BindValueChanged(selected => selectBox.FadeTo(selected.NewValue ? 1 : 0)); + Action = () => SelectorActive.Value = true; + } + + protected override bool OnHover(HoverEvent e) + { + hoverBox.FadeIn(300, Easing.OutQuint); + return base.OnHover(e); + } + + protected override void OnHoverLost(HoverLostEvent e) + { + hoverBox.FadeOut(200, Easing.OutQuint); + base.OnHoverLost(e); + } + } +} From a0a2f8118e520003c23993bb2074d5664803758f Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Fri, 15 Apr 2022 22:05:20 +0100 Subject: [PATCH 02/14] Code quality fixes --- osu.Game/Overlays/Chat/ChannelList/ChannelList.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index 4ffb6be451..9fcd675dc5 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -73,8 +73,8 @@ namespace osu.Game.Overlays.Chat.ChannelList return; ChannelListItem item = new ChannelListItem(channel); - item.OnRequestSelect += channel => this.OnRequestSelect?.Invoke(channel); - item.OnRequestLeave += channel => this.OnRequestLeave?.Invoke(channel); + item.OnRequestSelect += chan => OnRequestSelect?.Invoke(chan); + item.OnRequestLeave += chan => OnRequestLeave?.Invoke(chan); ChannelListItemFlow flow = getFlowForChannel(channel); channelMap.Add(channel, item); @@ -153,19 +153,19 @@ namespace osu.Game.Overlays.Chat.ChannelList protected class ChannelListScrollBar : OsuScrollbar { - private const float BAR_SIZE = 4; - private const float BAR_MARGIN = 7; + private const float bar_size = 4; + private const float bar_margin = 7; public ChannelListScrollBar(Direction scrollDir) : base(scrollDir) { - Size = new Vector2(BAR_SIZE); - Margin = new MarginPadding { Left = BAR_MARGIN }; + Size = new Vector2(bar_size); + Margin = new MarginPadding { Left = bar_margin }; CornerRadius = 2; } public override void ResizeTo(float val, int duration = 0, Easing easing = Easing.None) { - Vector2 size = new Vector2(BAR_SIZE, val); + Vector2 size = new Vector2(bar_size, val); this.ResizeTo(size, duration, easing); } } From b6631fb9f97e5add211cc4187fef2f03210b71fd Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Fri, 15 Apr 2022 22:22:20 +0100 Subject: [PATCH 03/14] Add newline for base class call --- osu.Game/Overlays/Chat/ChannelList/ChannelList.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index 9fcd675dc5..94c05770ab 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -156,7 +156,8 @@ namespace osu.Game.Overlays.Chat.ChannelList private const float bar_size = 4; private const float bar_margin = 7; - public ChannelListScrollBar(Direction scrollDir) : base(scrollDir) + public ChannelListScrollBar(Direction scrollDir) + : base(scrollDir) { Size = new Vector2(bar_size); Margin = new MarginPadding { Left = bar_margin }; From 4a0c5a07813fb94107e40acc9295f3f315abdf08 Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Sat, 16 Apr 2022 19:16:06 +0100 Subject: [PATCH 04/14] Remove hover override for `ChannelListScrollContainer` --- osu.Game/Overlays/Chat/ChannelList/ChannelList.cs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index 94c05770ab..ef2f132501 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -10,7 +10,6 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input.Events; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -136,18 +135,6 @@ namespace osu.Game.Overlays.Chat.ChannelList private class ChannelListScrollContainer : OsuScrollContainer { - protected override bool OnHover(HoverEvent e) - { - ScrollbarVisible = true; - return base.OnHover(e); - } - - protected override void OnHoverLost(HoverLostEvent e) - { - ScrollbarVisible = false; - base.OnHoverLost(e); - } - protected override ScrollbarContainer CreateScrollbar(Direction direction) => new ChannelListScrollBar(direction); From 36aea9009e754ebd18872d259a137e2df8f52a88 Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Sat, 16 Apr 2022 19:19:18 +0100 Subject: [PATCH 05/14] Move `ChannelList` scrollbar to the right --- osu.Game/Overlays/Chat/ChannelList/ChannelList.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index ef2f132501..759242a779 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -44,7 +44,7 @@ namespace osu.Game.Overlays.Chat.ChannelList { Padding = new MarginPadding { Vertical = 7 }, RelativeSizeAxes = Axes.Both, - ScrollbarAnchor = Anchor.TopLeft, + ScrollbarAnchor = Anchor.TopRight, ScrollDistance = 35f, Child = new FillFlowContainer { @@ -147,7 +147,7 @@ namespace osu.Game.Overlays.Chat.ChannelList : base(scrollDir) { Size = new Vector2(bar_size); - Margin = new MarginPadding { Left = bar_margin }; + Margin = new MarginPadding { Horizontal = bar_margin }; CornerRadius = 2; } From 2f41cddb00124179b13ae5c69a633f00805dbec9 Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Sat, 16 Apr 2022 19:28:24 +0100 Subject: [PATCH 06/14] Remove redundant `Expire` call --- osu.Game/Overlays/Chat/ChannelList/ChannelList.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index 759242a779..250e0cdf21 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -90,7 +90,6 @@ namespace osu.Game.Overlays.Chat.ChannelList channelMap.Remove(channel); flow.Remove(item); - item.Expire(); } public ChannelListItem GetItem(Channel channel) From 47c8b8010f1580ee9c7e583d0340f85f4c791e1d Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Sat, 16 Apr 2022 19:30:03 +0100 Subject: [PATCH 07/14] Use semibold font weight for `ChannelListItemFlow` label --- osu.Game/Overlays/Chat/ChannelList/ChannelList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index 250e0cdf21..5c2a1ad89f 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -127,7 +127,7 @@ namespace osu.Game.Overlays.Chat.ChannelList { Text = label, Margin = new MarginPadding { Left = 18, Bottom = 5 }, - Font = OsuFont.Torus.With(size: 12), + Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold), }); } } From 44c822f34d7a332ba41381d871c42814e9a6daea Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Tue, 19 Apr 2022 16:56:55 +0100 Subject: [PATCH 08/14] Use normal `OsuScrollContainer` for `ChannelList` --- .../Overlays/Chat/ChannelList/ChannelList.cs | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index 5c2a1ad89f..94c1a99a81 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Chat.ChannelList RelativeSizeAxes = Axes.Both, Colour = colourProvider.Background6, }, - new ChannelListScrollContainer + new OsuScrollContainer { Padding = new MarginPadding { Vertical = 7 }, RelativeSizeAxes = Axes.Both, @@ -131,31 +131,5 @@ namespace osu.Game.Overlays.Chat.ChannelList }); } } - - private class ChannelListScrollContainer : OsuScrollContainer - { - protected override ScrollbarContainer CreateScrollbar(Direction direction) - => new ChannelListScrollBar(direction); - - protected class ChannelListScrollBar : OsuScrollbar - { - private const float bar_size = 4; - private const float bar_margin = 7; - - public ChannelListScrollBar(Direction scrollDir) - : base(scrollDir) - { - Size = new Vector2(bar_size); - Margin = new MarginPadding { Horizontal = bar_margin }; - CornerRadius = 2; - } - - public override void ResizeTo(float val, int duration = 0, Easing easing = Easing.None) - { - Vector2 size = new Vector2(bar_size, val); - this.ResizeTo(size, duration, easing); - } - } - } } } From e596c9d1713f82f3000f1c5029ee20d4a96ebdb3 Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Wed, 20 Apr 2022 19:12:43 +0100 Subject: [PATCH 09/14] Use `Bindable` to control selector active visibility --- .../Visual/Online/TestSceneChannelList.cs | 9 +++-- .../Overlays/Chat/ChannelList/ChannelList.cs | 8 +++- .../Chat/ChannelList/ChannelListItem.cs | 38 +++++++++++-------- .../Chat/ChannelList/ChannelListSelector.cs | 14 ++++++- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs b/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs index d6a1e71f0d..2bfe42e6d4 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs @@ -25,6 +25,9 @@ namespace osu.Game.Tests.Visual.Online [Cached] private readonly Bindable selected = new Bindable(); + [Cached] + private readonly Bindable selector = new Bindable(); + private OsuSpriteText selectorText; private OsuSpriteText selectedText; private OsuSpriteText leaveText; @@ -89,7 +92,7 @@ namespace osu.Game.Tests.Visual.Online channelList.OnRequestSelect += channel => { - channelList.SelectorActive.Value = false; + selector.Value = ChannelSelectorState.Hidden; selected.Value = channel; }; @@ -101,9 +104,9 @@ namespace osu.Game.Tests.Visual.Online channelList.RemoveChannel(channel); }; - channelList.SelectorActive.BindValueChanged(change => + selector.BindValueChanged(change => { - selectorText.Text = $"Channel Selector Active: {change.NewValue}"; + selectorText.Text = $"Channel Selector State: {change.NewValue}"; }, true); selected.BindValueChanged(change => diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index 94c1a99a81..578ac2aa45 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -14,7 +14,6 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Online.Chat; -using osuTK; namespace osu.Game.Overlays.Chat.ChannelList { @@ -57,7 +56,6 @@ namespace osu.Game.Overlays.Chat.ChannelList new ChannelListSelector { Margin = new MarginPadding { Bottom = 10 }, - SelectorActive = { BindTarget = SelectorActive }, }, privateChannelFlow = new ChannelListItemFlow("DIRECT MESSAGES"), }, @@ -132,4 +130,10 @@ namespace osu.Game.Overlays.Chat.ChannelList } } } + + public enum ChannelSelectorState + { + Visibile, + Hidden, + } } diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs index 43574351ed..3d59d1dc4c 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs @@ -31,14 +31,17 @@ namespace osu.Game.Overlays.Chat.ChannelList private readonly Channel channel; - private Box? hoverBox; - private Box? selectBox; - private OsuSpriteText? text; - private ChannelListItemCloseButton? close; + private Box hoverBox = null!; + private Box selectBox = null!; + private OsuSpriteText text = null!; + private ChannelListItemCloseButton close = null!; [Resolved] private Bindable selectedChannel { get; set; } = null!; + [Resolved] + private Bindable selectorState { get; set; } = null!; + [Resolved] private OverlayColourProvider colourProvider { get; set; } = null!; @@ -124,31 +127,26 @@ namespace osu.Game.Overlays.Chat.ChannelList { base.LoadComplete(); - selectedChannel.BindValueChanged(change => - { - if (change.NewValue == channel) - selectBox?.FadeIn(300, Easing.OutQuint); - else - selectBox?.FadeOut(200, Easing.OutQuint); - }, true); + selectedChannel.BindValueChanged(_ => updateSelectState(), true); + selectorState.BindValueChanged(_ => updateSelectState(), true); Unread.BindValueChanged(change => { - text!.FadeColour(change.NewValue ? colourProvider.Content1 : colourProvider.Light3, 300, Easing.OutQuint); + text.FadeColour(change.NewValue ? colourProvider.Content1 : colourProvider.Light3, 300, Easing.OutQuint); }, true); } protected override bool OnHover(HoverEvent e) { - hoverBox?.FadeIn(300, Easing.OutQuint); - close?.FadeIn(300, Easing.OutQuint); + hoverBox.FadeIn(300, Easing.OutQuint); + close.FadeIn(300, Easing.OutQuint); return base.OnHover(e); } protected override void OnHoverLost(HoverLostEvent e) { - hoverBox?.FadeOut(200, Easing.OutQuint); - close?.FadeOut(200, Easing.OutQuint); + hoverBox.FadeOut(200, Easing.OutQuint); + close.FadeOut(200, Easing.OutQuint); base.OnHoverLost(e); } @@ -167,5 +165,13 @@ namespace osu.Game.Overlays.Chat.ChannelList Masking = true, }; } + + private void updateSelectState() + { + if (selectedChannel.Value == channel && selectorState.Value == ChannelSelectorState.Hidden) + selectBox.FadeIn(300, Easing.OutQuint); + else + selectBox.FadeOut(200, Easing.OutQuint); + } } } diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs index 5bc9a01598..4529a34f84 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs @@ -22,6 +22,9 @@ namespace osu.Game.Overlays.Chat.ChannelList private Box hoverBox = null!; private Box selectBox = null!; + [Resolved] + private Bindable selectorState { get; set; } = null!; + [BackgroundDependencyLoader] private void load(OverlayColourProvider colourProvider) { @@ -65,8 +68,15 @@ namespace osu.Game.Overlays.Chat.ChannelList { base.LoadComplete(); - SelectorActive.BindValueChanged(selected => selectBox.FadeTo(selected.NewValue ? 1 : 0)); - Action = () => SelectorActive.Value = true; + selectorState.BindValueChanged(selector => + { + if (selector.NewValue == ChannelSelectorState.Visibile) + selectBox.FadeIn(300, Easing.OutQuint); + else + selectBox.FadeOut(200, Easing.OutQuint); + }, true); + + Action = () => selectorState.Value = ChannelSelectorState.Visibile; } protected override bool OnHover(HoverEvent e) From 5319bce772d9e91857108628997c78a8284c79fc Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Wed, 20 Apr 2022 21:05:33 +0100 Subject: [PATCH 10/14] Revert DI usage of `ChannelSelectorState` in favour of directly binding `BindableBool` `SelectorActive` --- osu.Game.Tests/Visual/Online/TestSceneChannelList.cs | 9 +++------ osu.Game/Overlays/Chat/ChannelList/ChannelList.cs | 8 ++------ osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs | 9 ++++----- .../Overlays/Chat/ChannelList/ChannelListSelector.cs | 9 +++------ 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs b/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs index 2bfe42e6d4..d6a1e71f0d 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs @@ -25,9 +25,6 @@ namespace osu.Game.Tests.Visual.Online [Cached] private readonly Bindable selected = new Bindable(); - [Cached] - private readonly Bindable selector = new Bindable(); - private OsuSpriteText selectorText; private OsuSpriteText selectedText; private OsuSpriteText leaveText; @@ -92,7 +89,7 @@ namespace osu.Game.Tests.Visual.Online channelList.OnRequestSelect += channel => { - selector.Value = ChannelSelectorState.Hidden; + channelList.SelectorActive.Value = false; selected.Value = channel; }; @@ -104,9 +101,9 @@ namespace osu.Game.Tests.Visual.Online channelList.RemoveChannel(channel); }; - selector.BindValueChanged(change => + channelList.SelectorActive.BindValueChanged(change => { - selectorText.Text = $"Channel Selector State: {change.NewValue}"; + selectorText.Text = $"Channel Selector Active: {change.NewValue}"; }, true); selected.BindValueChanged(change => diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs index 578ac2aa45..076dc5719e 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelList.cs @@ -56,6 +56,7 @@ namespace osu.Game.Overlays.Chat.ChannelList new ChannelListSelector { Margin = new MarginPadding { Bottom = 10 }, + SelectorActive = { BindTarget = SelectorActive }, }, privateChannelFlow = new ChannelListItemFlow("DIRECT MESSAGES"), }, @@ -72,6 +73,7 @@ namespace osu.Game.Overlays.Chat.ChannelList ChannelListItem item = new ChannelListItem(channel); item.OnRequestSelect += chan => OnRequestSelect?.Invoke(chan); item.OnRequestLeave += chan => OnRequestLeave?.Invoke(chan); + item.SelectorActive.BindTarget = SelectorActive; ChannelListItemFlow flow = getFlowForChannel(channel); channelMap.Add(channel, item); @@ -130,10 +132,4 @@ namespace osu.Game.Overlays.Chat.ChannelList } } } - - public enum ChannelSelectorState - { - Visibile, - Hidden, - } } diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs index 3d59d1dc4c..7c4a72559b 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelListItem.cs @@ -29,6 +29,8 @@ namespace osu.Game.Overlays.Chat.ChannelList public readonly BindableBool Unread = new BindableBool(); + public readonly BindableBool SelectorActive = new BindableBool(); + private readonly Channel channel; private Box hoverBox = null!; @@ -39,9 +41,6 @@ namespace osu.Game.Overlays.Chat.ChannelList [Resolved] private Bindable selectedChannel { get; set; } = null!; - [Resolved] - private Bindable selectorState { get; set; } = null!; - [Resolved] private OverlayColourProvider colourProvider { get; set; } = null!; @@ -128,7 +127,7 @@ namespace osu.Game.Overlays.Chat.ChannelList base.LoadComplete(); selectedChannel.BindValueChanged(_ => updateSelectState(), true); - selectorState.BindValueChanged(_ => updateSelectState(), true); + SelectorActive.BindValueChanged(_ => updateSelectState(), true); Unread.BindValueChanged(change => { @@ -168,7 +167,7 @@ namespace osu.Game.Overlays.Chat.ChannelList private void updateSelectState() { - if (selectedChannel.Value == channel && selectorState.Value == ChannelSelectorState.Hidden) + if (selectedChannel.Value == channel && !SelectorActive.Value) selectBox.FadeIn(300, Easing.OutQuint); else selectBox.FadeOut(200, Easing.OutQuint); diff --git a/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs b/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs index 4529a34f84..57ab7584b5 100644 --- a/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs +++ b/osu.Game/Overlays/Chat/ChannelList/ChannelListSelector.cs @@ -22,9 +22,6 @@ namespace osu.Game.Overlays.Chat.ChannelList private Box hoverBox = null!; private Box selectBox = null!; - [Resolved] - private Bindable selectorState { get; set; } = null!; - [BackgroundDependencyLoader] private void load(OverlayColourProvider colourProvider) { @@ -68,15 +65,15 @@ namespace osu.Game.Overlays.Chat.ChannelList { base.LoadComplete(); - selectorState.BindValueChanged(selector => + SelectorActive.BindValueChanged(selector => { - if (selector.NewValue == ChannelSelectorState.Visibile) + if (selector.NewValue) selectBox.FadeIn(300, Easing.OutQuint); else selectBox.FadeOut(200, Easing.OutQuint); }, true); - Action = () => selectorState.Value = ChannelSelectorState.Visibile; + Action = () => SelectorActive.Value = true; } protected override bool OnHover(HoverEvent e) From a9163727db6195bee3a4212ad6d4c3cf8b1d0804 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Apr 2022 13:44:14 +0900 Subject: [PATCH 11/14] Mark selected channel null in test when selector is activated --- osu.Game.Tests/Visual/Online/TestSceneChannelList.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs b/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs index d6a1e71f0d..a3bfbd47a3 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneChannelList.cs @@ -104,6 +104,7 @@ namespace osu.Game.Tests.Visual.Online channelList.SelectorActive.BindValueChanged(change => { selectorText.Text = $"Channel Selector Active: {change.NewValue}"; + selected.Value = null; }, true); selected.BindValueChanged(change => From b4c208be63db5babf41d3301de4f07f59379a7c9 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 21 Apr 2022 15:34:01 +0900 Subject: [PATCH 12/14] Move Code Quality check to top of checks list --- .github/workflows/ci.yml | 110 +++++++++++++++++++-------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e7f9628fc..f2066f27de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,60 @@ on: [push, pull_request] name: Continuous Integration jobs: + inspect-code: + name: Code Quality + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + # FIXME: Tools won't run in .NET 6.0 unless you install 3.1.x LTS side by side. + # https://itnext.io/how-to-support-multiple-net-sdks-in-github-actions-workflows-b988daa884e + - name: Install .NET 3.1.x LTS + uses: actions/setup-dotnet@v1 + with: + dotnet-version: "3.1.x" + + - name: Install .NET 6.0.x + uses: actions/setup-dotnet@v1 + with: + dotnet-version: "6.0.x" + + - name: Restore Tools + run: dotnet tool restore + + - name: Restore Packages + run: dotnet restore + + - name: Restore inspectcode cache + uses: actions/cache@v3 + with: + path: ${{ github.workspace }}/inspectcode + key: inspectcode-${{ hashFiles('.config/dotnet-tools.json') }}-${{ hashFiles('.github/workflows/ci.yml' ) }} + + - name: CodeFileSanity + run: | + # TODO: Add ignore filters and GitHub Workflow Command Reporting in CFS. That way we don't have to do this workaround. + # FIXME: Suppress warnings from templates project + exit_code=0 + while read -r line; do + if [[ ! -z "$line" ]]; then + echo "::error::$line" + exit_code=1 + fi + done <<< $(dotnet codefilesanity) + exit $exit_code + + # Temporarily disabled due to test failures, but it won't work anyway until the tool is upgraded. + # - name: .NET Format (Dry Run) + # run: dotnet format --dry-run --check + + - name: InspectCode + run: dotnet jb inspectcode $(pwd)/osu.Desktop.slnf --no-build --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN + + - name: NVika + run: dotnet nvika parsereport "${{github.workspace}}/inspectcodereport.xml" --treatwarningsaserrors + test: name: Test runs-on: ${{matrix.os.fullname}} @@ -93,58 +147,4 @@ jobs: # cannot accept .sln(f) files as arguments. # Build just the main game for now. - name: Build - run: msbuild osu.iOS/osu.iOS.csproj /restore /p:Configuration=Debug - - inspect-code: - name: Code Quality - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - # FIXME: Tools won't run in .NET 6.0 unless you install 3.1.x LTS side by side. - # https://itnext.io/how-to-support-multiple-net-sdks-in-github-actions-workflows-b988daa884e - - name: Install .NET 3.1.x LTS - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "3.1.x" - - - name: Install .NET 6.0.x - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "6.0.x" - - - name: Restore Tools - run: dotnet tool restore - - - name: Restore Packages - run: dotnet restore - - - name: Restore inspectcode cache - uses: actions/cache@v3 - with: - path: ${{ github.workspace }}/inspectcode - key: inspectcode-${{ hashFiles('.config/dotnet-tools.json') }}-${{ hashFiles('.github/workflows/ci.yml' ) }} - - - name: CodeFileSanity - run: | - # TODO: Add ignore filters and GitHub Workflow Command Reporting in CFS. That way we don't have to do this workaround. - # FIXME: Suppress warnings from templates project - exit_code=0 - while read -r line; do - if [[ ! -z "$line" ]]; then - echo "::error::$line" - exit_code=1 - fi - done <<< $(dotnet codefilesanity) - exit $exit_code - - # Temporarily disabled due to test failures, but it won't work anyway until the tool is upgraded. - # - name: .NET Format (Dry Run) - # run: dotnet format --dry-run --check - - - name: InspectCode - run: dotnet jb inspectcode $(pwd)/osu.Desktop.slnf --no-build --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN - - - name: NVika - run: dotnet nvika parsereport "${{github.workspace}}/inspectcodereport.xml" --treatwarningsaserrors + run: msbuild osu.iOS/osu.iOS.csproj /restore /p:Configuration=Debug \ No newline at end of file From 54ca4b9d36f55bd9e3636b1c88eea0ef553753e6 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 21 Apr 2022 15:34:14 +0900 Subject: [PATCH 13/14] Remove unused using --- osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs b/osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs index 9807a65250..a9312e9a3a 100644 --- a/osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs +++ b/osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs @@ -14,7 +14,6 @@ using osu.Game.Database; using osu.Game.Online.API; using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.Spectator; -using osu.Game.Resources.Localisation.Web; using osu.Game.Screens; using osu.Game.Screens.OnlinePlay.Match.Components; using osu.Game.Screens.Play; From 414408140e0e66e394dafc1738c2a2c574496f87 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 21 Apr 2022 10:16:52 +0300 Subject: [PATCH 14/14] Improve AnchorOriginVisualiser --- osu.Game/Skinning/Editor/SkinBlueprint.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Skinning/Editor/SkinBlueprint.cs b/osu.Game/Skinning/Editor/SkinBlueprint.cs index 0a4bd1d75f..1860c6006c 100644 --- a/osu.Game/Skinning/Editor/SkinBlueprint.cs +++ b/osu.Game/Skinning/Editor/SkinBlueprint.cs @@ -146,8 +146,10 @@ namespace osu.Game.Skinning.Editor { anchorLine = new Box { - Colour = Color4.Yellow, Height = 2, + Origin = Anchor.CentreLeft, + Colour = Color4.Yellow, + EdgeSmoothness = Vector2.One }, originBox = new Box {