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