mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:45:09 +08:00
FIx code quality
This commit is contained in:
parent
7f4bfb25a9
commit
73a98b45e9
@ -4,15 +4,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Online.API;
|
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
using osu.Game.Overlays;
|
|
||||||
using osu.Game.Overlays.Chat;
|
using osu.Game.Overlays.Chat;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Online
|
namespace osu.Game.Tests.Visual.Online
|
||||||
@ -47,6 +43,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
Id = 3,
|
Id = 3,
|
||||||
Username = "LocalUser"
|
Username = "LocalUser"
|
||||||
};
|
};
|
||||||
|
|
||||||
string uuid = Guid.NewGuid().ToString();
|
string uuid = Guid.NewGuid().ToString();
|
||||||
AddStep("add local echo message", () => channel.AddLocalEcho(new LocalEchoMessage
|
AddStep("add local echo message", () => channel.AddLocalEcho(new LocalEchoMessage
|
||||||
{
|
{
|
||||||
@ -104,7 +101,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
|
|
||||||
int messageCount = 1;
|
int messageCount = 1;
|
||||||
|
|
||||||
AddRepeatStep($"add messages", () =>
|
AddRepeatStep("add messages", () =>
|
||||||
{
|
{
|
||||||
channel.AddNewMessages(new Message(messageCount)
|
channel.AddNewMessages(new Message(messageCount)
|
||||||
{
|
{
|
||||||
@ -116,7 +113,6 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
messageCount++;
|
messageCount++;
|
||||||
}, 10);
|
}, 10);
|
||||||
|
|
||||||
|
|
||||||
AddUntilStep("10 message present", () => drawableChannel.ChildrenOfType<ChatLine>().Count() == 10);
|
AddUntilStep("10 message present", () => drawableChannel.ChildrenOfType<ChatLine>().Count() == 10);
|
||||||
|
|
||||||
int checkCount = 0;
|
int checkCount = 0;
|
||||||
|
@ -81,12 +81,14 @@ namespace osu.Game.Overlays.Chat
|
|||||||
alteringBackground = value;
|
alteringBackground = value;
|
||||||
|
|
||||||
if (background == null)
|
if (background == null)
|
||||||
|
{
|
||||||
AddInternal(background = new Box
|
AddInternal(background = new Box
|
||||||
{
|
{
|
||||||
BypassAutoSizeAxes = Axes.Both,
|
BypassAutoSizeAxes = Axes.Both,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.White,
|
Colour = Color4.White,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
background.Alpha = value ? 0.04f : 0f;
|
background.Alpha = value ? 0.04f : 0f;
|
||||||
}
|
}
|
||||||
|
@ -107,8 +107,12 @@ namespace osu.Game.Overlays.Chat
|
|||||||
private void processMessageBackgroundAltering()
|
private void processMessageBackgroundAltering()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ChatLineFlow.Count(); i++)
|
for (int i = 0; i < ChatLineFlow.Count(); i++)
|
||||||
|
{
|
||||||
if (ChatLineFlow[i] is ChatLine chatline)
|
if (ChatLineFlow[i] is ChatLine chatline)
|
||||||
|
{
|
||||||
chatline.AlteringBackground = i % 2 == 0;
|
chatline.AlteringBackground = i % 2 == 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
Loading…
Reference in New Issue
Block a user