diff --git a/osu.Game.Tests/Visual/Online/TestSceneDrawableChannel.cs b/osu.Game.Tests/Visual/Online/TestSceneDrawableChannel.cs index 798bf48175..19f88826a7 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneDrawableChannel.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneDrawableChannel.cs @@ -4,15 +4,11 @@ using System; using System.Linq; using NUnit.Framework; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Logging; using osu.Framework.Testing; -using osu.Game.Online.API; using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.Chat; -using osu.Game.Overlays; using osu.Game.Overlays.Chat; namespace osu.Game.Tests.Visual.Online @@ -47,6 +43,7 @@ namespace osu.Game.Tests.Visual.Online Id = 3, Username = "LocalUser" }; + string uuid = Guid.NewGuid().ToString(); AddStep("add local echo message", () => channel.AddLocalEcho(new LocalEchoMessage { @@ -104,7 +101,7 @@ namespace osu.Game.Tests.Visual.Online int messageCount = 1; - AddRepeatStep($"add messages", () => + AddRepeatStep("add messages", () => { channel.AddNewMessages(new Message(messageCount) { @@ -116,7 +113,6 @@ namespace osu.Game.Tests.Visual.Online messageCount++; }, 10); - AddUntilStep("10 message present", () => drawableChannel.ChildrenOfType().Count() == 10); int checkCount = 0; diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 922d040d54..fc43e38239 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -81,12 +81,14 @@ namespace osu.Game.Overlays.Chat alteringBackground = value; if (background == null) + { AddInternal(background = new Box { BypassAutoSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both, Colour = Color4.White, }); + } background.Alpha = value ? 0.04f : 0f; } diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs index c817417a44..8e353bfebd 100644 --- a/osu.Game/Overlays/Chat/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -107,8 +107,12 @@ namespace osu.Game.Overlays.Chat private void processMessageBackgroundAltering() { for (int i = 0; i < ChatLineFlow.Count(); i++) + { if (ChatLineFlow[i] is ChatLine chatline) + { chatline.AlteringBackground = i % 2 == 0; + } + } } protected override void Dispose(bool isDisposing)