1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

Better style; removed initial sprites

This commit is contained in:
FreezyLemon 2017-12-27 17:14:08 +01:00
parent c4f5754f94
commit d21ef14f75

View File

@ -21,7 +21,6 @@ namespace osu.Game.Tests.Visual
private DependencyContainer dependencies;
private readonly TestChatLineContainer textContainer;
private readonly ChatLine[] testSprites;
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent);
@ -38,21 +37,25 @@ namespace osu.Game.Tests.Visual
Direction = FillDirection.Vertical,
});
testSprites = new[]
{
new ChatLine(new DummyMessage("Test!")),
new ChatLine(new DummyMessage("osu.ppy.sh!")),
new ChatLine(new DummyMessage("http://lookatmy.horse/")),
new ChatLine(new DummyMessage("https://osu.ppy.sh!")),
new ChatLine(new DummyMessage("00:12:345 (1,2) - Test?")),
new ChatLine(new DummyMessage("Wiki link for tasty [[Performance Points]]")),
new ChatLine(new DummyMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)")),
new ChatLine(new DummyMessage("[https://osu.ppy.sh/home New site] (new link format)")),
new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")),
new ChatLine(new DummyMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- <Version 0>]", true)),
new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- <Version 0>]", true)),
new ChatLine(new DummyMessage("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present).")),
};
testAddLinks();
}
private void testAddLinks()
{
int msgCounter = 0;
void addMessage(string text, bool isAction = false) => AddStep($"Add message #{++msgCounter}", () => textContainer.Add(new ChatLine(new DummyMessage(text, isAction))));
addMessage("Test!");
addMessage("osu.ppy.sh!");
addMessage("https://osu.ppy.sh!");
addMessage("00:12:345 (1,2) - Test?");
addMessage("Wiki link for tasty [[Performance Points]]");
addMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)");
addMessage("[https://osu.ppy.sh/home New site] (new link format)");
addMessage("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]");
addMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- <Version 0>]", true);
addMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- <Version 0>]", true);
addMessage("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present).");
}
[BackgroundDependencyLoader]
@ -60,8 +63,6 @@ namespace osu.Game.Tests.Visual
{
dependencies.Cache(chat);
dependencies.Cache(beatmapSetOverlay);
textContainer.AddRange(testSprites);
}
private class DummyMessage : Message